code: def _preserve_tensor_attrs(old: Tensor) -> Tensor:
      r"""
          Copies Tensor attributes (like self.cspace) of `old` in `new`. Both must be caer.Tensors
  
      Args:
          old (Tensor): caer Tensor
  
      Returns:
          caer Tensor
      """
      if not isinstance(old, Tensor):
          raise TypeError("`old` needs to be a caer.Tensor.")
  
      new = Tensor(old, cspace=None, dtype=old.dtype)
      new.cspace = old.cspace
      return new
  
imports: import numpy
  from .tensor import Tensor
  from typing import Tuple, Optional, Union
label_desc: Use image node_id 3 for calling a global function with example usage: _preserve_tensor_attrs(old) and returns: new