code: def norm(
      input: Union[Tensor, MaskedTensor],
      ord: Optional[float] = 2.0,
      dim: DimOrDims = None,
      *,
      keepdim: Optional[bool] = False,
      dtype: Optional[DType] = None,
      mask: Optional[Tensor] = None,
  ) -> Tensor:
      """\
  {reduction_signature}
  
  {reduction_descr}
  
  The identity value of norm operation, which is used to start the
  reduction, is ``{identity_float32}``, except for ``ord=-inf`` it is
  ``{identity_ord_ninf}``.
  
  {reduction_args}
  
  {reduction_example}"""
      if dtype is None:
          dtype = input.dtype
      mask_input = _combine_input_and_mask(norm, input, mask, ord)
      if mask_input.layout == torch.strided:
          dim_ = _canonical_dim(dim, input.ndim)
          return torch.linalg.vector_norm(
              mask_input, ord, dim_, bool(keepdim), dtype=dtype
          )
      else:
          raise ValueError(
              f"masked norm expects strided tensor (got {mask_input.layout} tensor)"
          )
  
imports: import warnings
  from typing import Any, List, Optional, Tuple, TYPE_CHECKING, Union
  import torch
  from torch import Tensor
  from torch.masked import as_masked_tensor, is_masked_tensor, MaskedTensor
  from .None import _docs
  from torch._prims_common import corresponding_real_dtype
  from torch import sym_float
label_desc: Use image node_id 27 for calling a global function with example usage: norm(input, ord, dim) and returns: torch