code: def tensor_norm(
      tensor, norm_type: Union[int, float, str] = 2
  ):  # pylint: disable=R1710
      """
      Compute the norm of a tensor.
  
      :param tensor: A tensor from a supported ART neural network.
      :param norm_type: Order of the norm.
      :return: A tensor with the norm applied.
      """
      tf_tensor_types = (
          "tensorflow.python.framework.ops.Tensor",
          "tensorflow.python.framework.ops.EagerTensor",
          "tensorflow.python.framework.ops.SymbolicTensor",
      )
      torch_tensor_types = (
          "torch.Tensor",
          "torch.float",
          "torch.double",
          "torch.long",
      )
      mxnet_tensor_types = ()
      supported_types = (
          tf_tensor_types + torch_tensor_types + mxnet_tensor_types
      )
      tensor_type = get_class_name(tensor)
      if tensor_type not in supported_types:  # pragma: no cover
          raise TypeError(
              "Tensor type `" + tensor_type + "` is not supported"
          )
  
      if tensor_type in tf_tensor_types:
          import tensorflow as tf
  
          return tf.norm(tensor, ord=norm_type)
  
      if tensor_type in torch_tensor_types:  # pragma: no cover
          import torch
  
          return torch.norm
  
      if tensor_type in mxnet_tensor_types:  # pragma: no cover
          import mxnet
  
          return mxnet.ndarray.norm(tensor, ord=norm_type)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from functools import reduce
  import logging
  from typing import Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.attacks.attack import PoisoningAttackWhiteBox
  from art.estimators import BaseEstimator, NeuralNetworkMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from art.estimators.classification.keras import KerasClassifier
  from art.estimators.classification.pytorch import PyTorchClassifier
label_desc: Use image node_id 2 for calling a global function with example usage: tensor_norm(tensor, norm_type) and returns: tf, torch, mxnet