Implement two utilities for tinygrad tensors:
flatten_then_reshape(x, new_shape) - first flatten x to 1-D, then lay the elements out in new_shape. The total number of elements must match.transpose_last_two(x) - swap the last two dimensions of x. This is how you turn (batch, in_features, out_features) into (batch, out_features, in_features).Both functions take and return tinygrad Tensor objects.
-1 and -2 regardless of how many leading batch dims the tensor has.