From 02e64da6786c630c7f858a80113b60ab4f7c465c Mon Sep 17 00:00:00 2001 From: Roelof van Dijk <3604013+roelofvandijk@users.noreply.github.com> Date: Fri, 25 Aug 2023 18:37:13 +0200 Subject: [PATCH] refactor: tuples can be concatenated with + (#1671) Co-authored-by: Roelof van Dijk --- tinygrad/tensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/tensor.py b/tinygrad/tensor.py index 0c83c1cb91..917f14f958 100644 --- a/tinygrad/tensor.py +++ b/tinygrad/tensor.py @@ -407,7 +407,7 @@ class Tensor: order = list(range(len(self.shape))) order[ax1], order[ax2] = order[ax2], order[ax1] return self.permute(order) - def flatten(self, start_dim=0): return self.reshape(shape=tuple(list(self.shape[0:start_dim]) + [-1])) + def flatten(self, start_dim=0): return self.reshape(shape=self.shape[:start_dim] + (-1,)) # ***** reduce ops *****