@@ -59,7 +59,7 @@ def _fromnp(x: 'np.ndarray') -> UOp: # type: ignore [name-defined] # noqa: F821
59
59
ret = UOp .metaop (Ops .EMPTY , x .shape , _from_np_dtype (x .dtype ), "NPY" )
60
60
# fake realize
61
61
ret .buffer .allocate (x )
62
- return ret . buf_uop_view ()
62
+ return ret
63
63
64
64
def get_shape (x ) -> tuple [int , ...]:
65
65
# NOTE: str is special because __getitem__ on a str is still a str
@@ -76,7 +76,7 @@ def _frompy(x:Union[List, Tuple, bytes], dtype:DType) -> UOp:
76
76
data = struct .pack (f"@{ ret .size } { dtype .fmt } " , * [truncate_function (xi ) for xi in fully_flatten (x )])
77
77
# fake realize
78
78
ret .buffer .allocate (memoryview (data if Device .DEFAULT != "PYTHON" else bytearray (data )))
79
- return ret . buf_uop_view ()
79
+ return ret
80
80
81
81
def _get_winograd_matcols (mat , dims :int , shp :tuple [sint , ...], device :Union [str , tuple [str , ...]], dtype :DType ) -> list [list [Tensor ]]:
82
82
return [[Tensor .cat (* [Tensor .full (shp [:dim ] + (1 ,) + shp [dim + 1 :], float (m [k ]), device = device , dtype = dtype ) for m in mat ], dim = dim )
@@ -449,7 +449,6 @@ def from_blob(ptr:int, shape:tuple[int, ...], **kwargs) -> Tensor:
449
449
450
450
r = Tensor ._metaop (Ops .EMPTY , shape , ** kwargs )
451
451
r .lazydata .buffer .allocate (external_ptr = ptr )
452
- r .lazydata .buf_uop_view ()
453
452
return r
454
453
455
454
@staticmethod
0 commit comments