Furthermore, a dimension name must be a valid Python variable
      name (i.e., does not start with underscore).
  Tensors may not have two named dimensions with the same name.

  Warning:

    The named tensor API is experimental and subject to change.

rename(names, *rename_map)
  Renames dimension names of "self".

  There are two main usages:

  "self.rename(**rename_map)" returns a view on tensor that has
  dims renamed as specified in the mapping "rename_map".

  "self.rename(*names)" returns a view on tensor, renaming all
  dimensions positionally using "names". Use "self.rename(None)"
  to drop names on a tensor.

  One cannot specify both positional args "names" and keyword args
  "rename_map".

  Examples:

     >>> imgs = torch.rand(2, 3, 5, 7, names=('N', 'C', 'H', 'W'))
     >>> renamed_imgs = imgs.rename(N='batch', C='channels')
     >>> renamed_imgs.names
     ('batch', 'channels', 'H', 'W')
