 Move away from np.flatten and to_bytes in log tensor.from_numpy if possible