Where3


tensorflow C++ API

tensorflow::ops::Where3

Computes the sum along segments of a tensor.


Summary

Thex, andytensors must all have the same shape, and the output will also have that shape.

Theconditiontensor must be a scalar ifxandyare scalars. Ifxandyare vectors or higher rank, thenconditionmust be either a scalar, a vector with size matching the first dimension ofx, or must have the same shape asx.

Theconditiontensor acts as a mask that chooses, based on the value at each element, whether the corresponding element / row in the output should be taken fromx(if true) ory(if false).

Ifconditionis a vector andxandyare higher rank matrices, then it chooses which row (outer dimension) to copy fromxandy. Ifconditionhas the same shape asxandy, then it chooses which element to copy fromxandy.

For example:

```python 'condition' tensor is [[True, False]

[False, True]]

't' is [[1, 2],[3, 4]]

'e' is [[5, 6],[7, 8]]

select(condition, t, e) # => [[1, 6], [7, 4]]

'condition' tensor is [True, False]

't' is [[1, 2],[3, 4]]

'e' is [[5, 6],[7, 8]]

select(condition, t, e) ==> [[1, 2], [7, 8]]

```

Arguments:

  • scope: A Scope object
  • x: = ATensorwhich may have the same shape ascondition. Ifconditionis rank 1,xmay have higher rank, but its first dimension must match the size ofcondition.
  • y: = ATensorwith the same type and shape asx.

Returns:

Constructor

  • Where3(const ::tensorflow::Scope & scope, ::tensorflow::Input condition, ::tensorflow::Input x, ::tensorflow::Input y)

Public attributes

  • tensorflow::Output output.

Where3 block

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

Argument:

  • Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.).
  • Input condition : connect Input node.
  • Input x : connect Input node.
  • Input y : connect Input node.

Return:

  • Output output: Output object of Where3 class object.

Result:

  • std::vector(Tensor) product_result : Returned object of executed result by calling session.

Using Method

results matching ""

    No results matching ""