get_dimension_size

tfsnippet.utils.get_dimension_size(tensor, axis, name=None)

Get the size of tensor of specified axis.

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

An integer or a tensor, the size of queried dimension.

Return type:

int or tf.Tensor