From 4579e1351c6c4ef14008f051bf7aa3096cc4945e Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 6 Mar 2024 19:39:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20hack=5Ftensor.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hack_tensor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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