code: def validate(self, instance, value):
          
  
          value = super(BaseVector, self).validate(instance, value)
  
          if self.length is not None:
              try:
                  value.length = self._length_array(value)
              except ZeroDivisionError:
                  self.error(
                      instance, value,
                      error_class=ZeroDivValidationError,
                      extra='The vector must have a length specified.'
                  )
          return value
docs: Check shape and dtype of vector and scales it to given length