code: def series_from_tensor(
      tensor: Tensor,
      index: Union[TileableType, pd.Index, list] = None,
      name: Any = None,
      dtype: np.dtype = None,
      gpu: bool = None,
      sparse: bool = False,
  ):
      if tensor is not None:
          if tensor.ndim > 1 or tensor.ndim <= 0:
              raise TypeError(
                  f"Not support create Series from {tensor.ndim} dims tensor"
              )
          gpu = tensor.op.gpu if gpu is None else gpu
          dtype = dtype or tensor.dtype
      else:
          gpu = None
          dtype = dtype or np.dtype(float)
      op = SeriesFromTensor(input=tensor, gpu=gpu, sparse=sparse)
      return op(tensor, index, dtype, name)
  
imports: from collections import OrderedDict
  from typing import Any, Dict, List, Union
  import numpy
  import pandas
  from ...None import opcodes
  from ...core import ENTITY_TYPE, OutputType, recursive_tile
  from ...core.context import Context
  from ...serialization.serializables import KeyField, AnyField
  from ...tensor.core import Tensor
  from ...tensor.datasource import tensor
  from ...tensor.utils import unify_chunks
  from ...typing import EntityType, TileableType
  from ...utils import has_unknown_shape
  from ..core import INDEX_TYPE, SERIES_TYPE
  from ..operands import DataFrameOperand, DataFrameOperandMixin
  from ..utils import parse_index
label_desc: Use image node_id 3 for calling a global function with example usage: series_from_tensor(tensor, index, name, dtype, gpu, sparse) and returns: op