code: def from_tensor(cls, tensor: torch.Tensor) -> TensorDescriptor:
      return cls(
          tensor.shape,
          tensor.dtype,
          tensor.layout,
          tensor.device,
          tensor.requires_grad,
          _safe_check_pinned(tensor),
      )
  
imports: from __future__ import annotations
  import warnings
  from dataclasses import asdict, dataclass
  from typing import Tuple
  import numpy
  import torch
  from hivemind.proto.runtime_pb2 import CompressionType
  from hivemind.utils.serializer import MSGPackSerializer
label_desc: Use image node_id 3 for calling the TensorDescriptor obj's underlying member method code with example usage: obj.from_tensor(cls, tensor) and returns: cls