class_docstr: Auxiliary data structure that contains information about the tensor that determines how it is compressed
class_docstr_tok: ["Auxiliary","data","structure","that","contains","information","about","the","tensor","that","determines","how","it","is","compressed"]
code: def from_tensor(
      cls,
      tensor: torch.Tensor,
      key: Key = None,
      descriptor: TensorDescriptor = None,
      **kwargs,
  ):
      return cls(
          key,
          descriptor or TensorDescriptor.from_tensor(tensor),
          **kwargs,
      )
  
imports: import dataclasses
  import os
  import warnings
  from abc import ABC, abstractmethod
  from enum import Enum, auto
  from typing import Any, Optional
  import numpy
  import torch
  from hivemind.proto import runtime_pb2
  from hivemind.utils.tensor_descr import TensorDescriptor
label_desc: Use image node_id 1 for calling the CompressionInfo obj's underlying member method code with example usage: obj.from_tensor(cls, tensor, key, descriptor) and returns: cls