get_dimensions_size

tfsnippet.utils.get_dimensions_size(tensor, axes=None, name=None)

Get the size of tensor of specified axes.

If axes is None, select the size of all dimensions.

Parameters:
  • tensor (tf.Tensor) – The tensor to be tested.
  • axes (Iterable[int] or None) – The dimensions to be selected.
  • name (str) – Default name of the name scope. If not specified, generate one according to the method name.
Returns:

A tuple of integers if all selected

dimensions have static sizes. Otherwise a tensor.

Return type:

tuple[int] or tf.Tensor