@@ -38,7 +38,7 @@ def data(self):
3838 return data
3939
4040 @property
41- def type (self ) -> Dtype :
41+ def dtype (self ) -> Dtype :
4242 dtype = c_int ()
4343 status = get_fxnc ().FXNValueGetType (self .__value , byref (dtype ))
4444 if status != FXNStatus .OK :
@@ -47,7 +47,7 @@ def type(self) -> Dtype:
4747
4848 @property
4949 def shape (self ) -> tuple [int , ...] | None :
50- if self .type not in _TENSOR_ISH_DTYPES :
50+ if self .dtype not in _TENSOR_ISH_DTYPES :
5151 return None
5252 fxnc = get_fxnc ()
5353 dims = c_int32 ()
@@ -79,7 +79,7 @@ def serialize(self, mime: str=None) -> bytes:
7979 return result
8080
8181 def to_object (self ) -> Object :
82- match self .type :
82+ match self .dtype :
8383 case Dtype .null : return None
8484 case t if t in _TENSOR_DTYPES :
8585 ctype = as_ctypes_type (dtype (t ))
@@ -92,7 +92,7 @@ def to_object(self) -> Object:
9292 data = as_array (cast (self .data , POINTER (c_uint8 )), self .shape ).copy ()
9393 return Image .fromarray (data .squeeze ())
9494 case Dtype .binary : return string_at (self .data , self .shape [0 ])
95- case _: raise ValueError (f"Failed to convert value with type `{ self .type } ` to object because it is not supported" )
95+ case _: raise ValueError (f"Failed to convert value with type `{ self .dtype } ` to object because it is not supported" )
9696
9797 def __enter__ (self ):
9898 return self
0 commit comments