code: def from_java(cls, java_tensor_info: JavaObject) -> "TensorInfo":
      shape = list(java_tensor_info.getShape())
      type = java_gateway.get_field(java_tensor_info, "type").toString()
      return cls(shape, type)
  
imports: from abc import ABCMeta
  import sys
  from typing import Mapping, List
  from py4j import java_gateway
  from synapse.ml.onnx._ONNXModel import _ONNXModel
  from pyspark.ml.common import inherit_doc
  from py4j.java_gateway import JavaObject
label_desc: Use image node_id 4 for calling the TensorInfo obj's underlying member method code with example usage: obj.from_java(cls, java_tensor_info) and returns: cls