code: def norm(self, x):
          
          if self.exponent == 2.0:
              return float(np.sqrt(self.const) * _norm_default(x))
          elif self.exponent == float('inf'):
              return float(self.const * _pnorm_default(x, self.exponent))
          else:
              return float((self.const ** (1 / self.exponent) *
                            _pnorm_default(x, self.exponent)))
docs: Return the weighted norm of ``x``.
  
          Parameters
          ----------
          x1 : `NumpyTensor`
              Tensor whose norm is calculated.
  
          Returns
          -------
          norm : float
              The norm of the tensor.