DiagPart


tensorflow C++ API

tensorflow::ops::DiagPart

Returns the diagonal part of the tensor.


Summary

This operation returns a tensor with thediagonalpart of theinput. Thediagonalpart is computed as follows:

Assumeinputhas dimensions[D1,..., Dk, D1,..., Dk], then the output is a tensor of rankkwith dimensions[D1,..., Dk]where:

diagonal[i1,..., ik] = input[i1, ..., ik, i1,..., ik].

For example:

``` 'input' is [[1, 0, 0, 0]

[0, 2, 0, 0] [0, 0, 3, 0] [0, 0, 0, 4]]

tf.diag_part(input) ==> [1, 2, 3, 4] ```

Arguments:

  • scope: A Scope object
  • input: Rank k tensor where k is 2, 4, or 6.

Returns:

  • Output: The extracted diagonal.

DiagPart 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: ATensor . Must be one of the following types: float32 ,float64 ,int32 ,int64 ,complex64 ,complex128 . Rank k tensor where k is 2, 4, or 6.

Return:

  • Output output : Output object of Diag class object.

Result:

  • std::vector(Tensor) result_output : Assume inputhas dimensions [D1,..., Dk, D1,..., Dk] , then the output is a tensor of rank k with dimensions [D1,..., Dk]

Using Method

※ Rank를 줄여주는 역할을 한다.

results matching ""

    No results matching ""