class_docstr: A tf.TypeSpec for `AutoCompositeTensor` objects.
class_docstr_tok: ["A","tf.TypeSpec","for","`","AutoCompositeTensor","`","objects","."]
docstr: Returns a TypeSpec compatible with `self`, with tensor shapes relaxed.
  
  Returns:
    A `TypeSpec` that is compatible with `self`, where any `TensorShape`
    information has been relaxed to include only tensor rank (and not
    the dimension sizes for individual axes).
docstr_tok: ["Returns","a","TypeSpec","compatible","with","`","self","`",",","with","tensor","shapes","relaxed",".","Returns",":","A","`","TypeSpec","`","that","is","compatible","with","`","self","`",",","where","any","`","TensorShape","`","information","has","been","relaxed","to","include","only","tensor","rank","(","and","not","the","dimension","sizes","for","individual","axes",")","."]
code: def _with_tensor_ranks_only(self):
      """Returns a TypeSpec compatible with `self`, with tensor shapes relaxed.
  
      Returns:
        A `TypeSpec` that is compatible with `self`, where any `TensorShape`
        information has been relaxed to include only tensor rank (and not
        the dimension sizes for individual axes).
      """
  
      def relax(value):
          if isinstance(value, tf.TypeSpec):
              return (
                  value._with_tensor_ranks_only()
              )  # pylint: disable=protected-access
          elif (
              isinstance(value, tf.TensorShape)
              and value.rank is not None
          ):
              return tf.TensorShape([None] * value.rank)
          else:
              return value
  
      return self._copy(
          param_specs=tf.nest.map_structure(relax, self._param_specs)
      )
  
imports: import contextlib
  import functools
  import threading
  import numpy
  import tensorflow.compat.v2
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import type_spec
  from tensorflow.python.framework import type_spec_registry
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.util import tf_inspect
  from tensorflow.python.util import variable_utils
label_desc: Use image node_id 12 for calling the _AutoCompositeTensorTypeSpec obj's underlying member method code with example usage: obj._with_tensor_ranks_only() and returns: self, value, tf, value