code: # global
  import tensorflow as tf
  from tensorflow.python.types.core import Tensor
  from typing import Union, Optional, Tuple, Literal
  
  # local
  from ivy import inf
  
  
  # noinspection PyUnusedLocal,PyShadowingBuiltins
  def vector_norm(x: Tensor,
                  axis: Optional[Union[int, Tuple[int]]] = None, 
                  keepdims: bool = False,
                  ord: Union[int, float, Literal[inf, - inf]] = 2)\
                   -> Tensor:
  
      if ord == -float('inf'):
          tn_normalized_vector = tf.reduce_min(tf.abs(x), axis, keepdims)
      elif ord == -1:
          tn_normalized_vector = tf.reduce_sum(tf.abs(x)**ord, axis, keepdims)**(1./ord)
  
      elif ord == 0:
          tn_normalized_vector = tf.reduce_sum(tf.cast(x != 0, 'float32'), axis, keepdims).numpy()
  
      else:
          tn_normalized_vector = tf.linalg.norm(x, ord, axis, keepdims)
  
      if tn_normalized_vector.shape == tuple():
          return tf.expand_dims(tn_normalized_vector, 0)
      return tn_normalized_vector
  
apis: tensorflow.cast tensorflow.abs tensorflow.linalg.norm tensorflow.expand_dims