TensorScatterMax

public final class TensorScatterMax

Apply a sparse update to a tensor taking the element-wise maximum.

Returns a new tensor copied from `tensor` whose values are element-wise maximum between tensor and updates according to the indices.

>>> tensor = [0, 0, 0, 0, 0, 0, 0, 0] >>> indices = [[1], [4], [5]] >>> updates = [1, -1, 1] >>> tf.tensor_scatter_nd_max(tensor, indices, updates).numpy() array([0, 1, 0, 0, 0, 1, 0, 0], dtype=int32)

Refer to tf.tensor_scatter_nd_update for more details.

Public Methods

Output<T>
asOutput()
Returns the symbolic handle of a tensor.
static <T, U extends Number> TensorScatterMax<T>
create(Scope scope, Operand<T> tensor, Operand<U> indices, Operand<T> updates)
Factory method to create a class wrapping a new TensorScatterMax operation.
Output<T>
output()
A new tensor copied from tensor whose values are element-wise maximum between tensor and updates according to the indices.

Inherited Methods

Public Methods

public Output<T> asOutput ()

Returns the symbolic handle of a tensor.

Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.

public static TensorScatterMax<T> create (Scope scope, Operand<T> tensor, Operand<U> indices, Operand<T> updates)

Factory method to create a class wrapping a new TensorScatterMax operation.

Parameters
scope current scope
tensor Tensor to update.
indices Index tensor.
updates Updates to scatter into output.
Returns
  • a new instance of TensorScatterMax

public Output<T> output ()

A new tensor copied from tensor whose values are element-wise maximum between tensor and updates according to the indices.