Link Search Menu Expand Document

Rank


tensorflow C++ API

tensorflow::ops::Rank

Returns the rank of a tensor.


Summary

This operation returns an integer representing the rank ofinput.

For example:

``` ‘t’ is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]

shape of tensor ‘t’ is [2, 2, 3]

rank(t) ==> 3 ```

Note: The rank of a tensor is not the same as the rank of a matrix. The rank of a tensor is the number of indices required to uniquely select each element of the tensor. Rank is also known as “order”, “degree”, or “ndims.”

Arguments:

Returns:


Rank block

Source link :https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_array_ops.cpp

Argument:

  • Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
  • Input input: any tensor.

Output:

  • Output output : Output object of Rank class object.

Result:

  • std::vector(Tensor) result_output: Returns the rank of a tensor.

Using Method

※input으로 들어온 tensor의 rank를 계산한다.