torch.Tensor.dim_order
- Tensor.dim_order(ambiguity_check=False) → tuple
Returns the uniquely determined tuple of int describing the dim order or physical layout of
self.The dim order represents how dimensions are laid out in memory of dense tensors, starting from the outermost to the innermost dimension.
Note that the dim order may not always be uniquely determined. If ambiguity_check is True, this function raises a RuntimeError when the dim order cannot be uniquely determined; If is a list of memory formats, this function raises a RuntimeError when tensor can not be interpreted into exactly one of the given memory formats, or it cannot be uniquely determined. If is False, it will return one of legal dim order(s) without checking its uniqueness. Otherwise, it will raise TypeError.