tfp.experimental.distributions.marginal_fns.ps.tensorshape_util.rank

Returns the rank implied by this shape, or None if it is unspecified.

For more details, see help(tf.TensorShape.rank).

x object representing a shape; anything convertible to tf.TensorShape, or a Tensor (interpreted as an in-graph computed shape).

rank int representing the number of shape dimensions, or None if not statically known.