make full with buffer=False deviceless (#16483)

affects arange and eye
This commit is contained in:
chenyu 2026-06-03 12:35:59 -04:00 committed by GitHub
commit 8a4203638a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 39 additions and 47 deletions

View file

@ -569,8 +569,8 @@ tiny_backend = {**{k:wrap_out(v) for k,v in tiny_backend_out.items()}, **{
"aten.__rshift__.Scalar": lambda x,y: x>>y,
"aten.__irshift__.Scalar": lambda x,y: x>>y,
# inplace ops using replace for fusion
"aten.zero_": lambda x: x.const_like(0),
"aten.fill_.Scalar": lambda x, y: x.const_like(y),
"aten.zero_": lambda x: Tensor.full(x.shape, 0, dtype=x.dtype, device=x.device, buffer=False),
"aten.fill_.Scalar": lambda x, y: Tensor.full(x.shape, y, dtype=x.dtype, device=x.device, buffer=False),
"aten.add_.Tensor": lambda self, other, alpha=1.0: self + other * alpha,
"aten.add_.Scalar": lambda self, other, alpha=1.0: self + other * alpha,
"aten.mul_.Tensor": lambda self, other: self * other,
@ -622,7 +622,7 @@ tiny_backend = {**{k:wrap_out(v) for k,v in tiny_backend_out.items()}, **{
"aten.asinh": Tensor.asinh,
"aten.mul": Tensor.mul,
"aten.atanh": Tensor.atanh,
"aten.fill_.Tensor": lambda self, value: self.const_like(value.reshape(()).item()),
"aten.fill_.Tensor": lambda self, value: Tensor.full(self.shape, value.reshape(()).item(), dtype=self.dtype, device=self.device, buffer=False),
"aten.flip": Tensor.flip,
"aten.scatter_reduce.two": Tensor.scatter_reduce,
"aten.squeeze_.dim": Tensor.squeeze,