code: def einsum(
      equation: str,
      *operands: Union[tf.Tensor, tf.Variable],
      out: Optional[Union[tf.Tensor, tf.Variable]] = None,
  ) -> Union[tf.Tensor, tf.Variable]:
      equation = legalise_einsum_expr(*[equation, *operands])
      dtype_list = set(map(lambda x: x.dtype, operands))
      dtype = dtype_list.pop()
      if len(dtype_list) > 0:
          for d in dtype_list:
              dtype = ivy.promote_types(dtype, d)
          dtype = ivy.as_native_dtype(dtype)
          operands = list(
              map(
                  lambda x: tf.cast(x, dtype)
                  if x.dtype != dtype
                  else x,
                  operands,
              )
          )
  
      return tf.einsum(equation, *operands)
  
file_path: ivy/ivy/functional/backends/tensorflow/statistical.py
imports: import tensorflow
  from typing import Union, Optional, Sequence
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
  from ivy.utils.einsum_parser import legalise_einsum_expr
label_desc: Use image node_id 11 for calling a global function with example usage: einsum(equation) and returns: tf