refactor: tuples can be concatenated with + (#1671)

Co-authored-by: Roelof van Dijk <roelof.van.dijk@vitestro.com>
This commit is contained in:
Roelof van Dijk
2023-08-25 18:37:13 +02:00
committed by GitHub
parent 173850f599
commit 02e64da678

View File

@@ -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 *****