class_docstr: Type spec for `JointDistributionSequential`.
class_docstr_tok: ["Type","spec","for","`","JointDistributionSequential","`","."]
code: def from_instance(cls, obj):
      param_specs, callable_params = [], []
      for i, d in enumerate(obj.model):
          if isinstance(d, tf.__internal__.CompositeTensor):
              param_specs.append(
                  d._type_spec
              )  # pylint: disable=protected-access
          else:  # Guaranteed to be a callable by the check in JDS.__new__.
              callable_params.append((i, d))
      non_tensor_params = {
          k: v for k, v in obj.parameters.items() if k != "model"
      }
      return cls(
          param_specs=dict(model=type(obj.model)(param_specs)),
          non_tensor_params=non_tensor_params,
          non_identifying_kwargs=("name",),
          omit_kwargs=("parameters",),
          prefer_static_value=("batch_ndims",),
          callable_params=dict(callable_params),
      )
  
imports: import collections
  import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import joint_distribution
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 4 for calling the _JointDistributionSequentialSpec obj's underlying member method code with example usage: obj.from_instance(cls, obj) and returns: cls