diff --git a/hack_tensor.md b/hack_tensor.md index 4eb26ad..7da9e79 100644 --- a/hack_tensor.md +++ b/hack_tensor.md @@ -4,7 +4,7 @@ python3.10/site-packages/torch/_tensor.py ``` def __repr__(self, *, tensor_contents=None): - return "Tensor %s" % (str(self.size())) + return "Tensor " + str(self.size()) + " " + self.device.type + " " + str(self.dtype) if has_torch_function_unary(self): return handle_torch_function( Tensor.__repr__, (self,), self, tensor_contents=tensor_contents