megengine.Tensor.flatten

Tensor.flatten(start_axis=0, end_axis=- 1)

See flatten.