code: def fetch_layout(tensor: tensor_lib.Tensor) -> layout_lib.Layout:
      """Fetches the layout of a DTensor.
  
      Args:
        tensor: The DTensor whose layout is to be fetched.
  
      Returns:
        The `Layout` of this DTensor.
  
      Raises:
        RuntimeError: When not called eagerly.
      """
      return _dtensor_device().fetch_layout(tensor)
  
imports: import contextlib
  import threading
  from typing import Any, Callable, Optional, Sequence
  from tensorflow.dtensor.python import dtensor_device
  from tensorflow.dtensor.python import gen_dtensor_ops
  from tensorflow.dtensor.python import layout
  from tensorflow.python.eager import context
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.util import deprecation
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 10 for calling a global function with example usage: fetch_layout(tensor) and returns: _dtensor_device