parameters: (value)
docstring: Returns shape of the input `Tensor` or a `np.ndarray`.
  
    If `value` is a `np.ndarray` or a `Tensor` with statically known shape, it
    returns a Python object. Otherwise, returns result of `tf.shape(value)`.
  
    Args:
      value: A `Tensor` or a `np.ndarray` object.
  
    Returns:
      Static or dynamic shape of `value`.
  
    Raises:
      TypeError:
        If the input is not a `Tensor` or a `np.ndarray` object.
docstring_summary: Returns shape of the input `Tensor` or a `np.ndarray`.
docstring_tokens: Returns shape of the input Tensor or a np . ndarray .
function: def static_or_dynamic_shape(value):
    """Returns shape of the input `Tensor` or a `np.ndarray`.
  
    If `value` is a `np.ndarray` or a `Tensor` with statically known shape, it
    returns a Python object. Otherwise, returns result of `tf.shape(value)`.
  
    Args:
      value: A `Tensor` or a `np.ndarray` object.
  
    Returns:
      Static or dynamic shape of `value`.
  
    Raises:
      TypeError:
        If the input is not a `Tensor` or a `np.ndarray` object.
    """
    if tf.is_tensor(value):
      return value.shape if value.shape.is_fully_defined() else tf.shape(value)
    elif isinstance(value, np.ndarray):
      return value.shape
    else:
      raise TypeError('The provided input is not a Tensor or numpy array.')
function_tokens: def static_or_dynamic_shape ( value ) : if tf . is_tensor ( value ) : return value . shape if value . shape . is_fully_defined ( ) else tf . shape ( value ) elif isinstance ( value , np . ndarray ) : return value . shape else : raise TypeError ( 'The provided input is not a Tensor or numpy array.' )