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

org.tensorflow.op.PrimitiveOp
final boolean
equals(Object obj)
final int
Operation
op()
Returns the underlying Operation
final String
boolean
equals(Object arg0)
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
org.tensorflow.Operand
abstract Output<T>
asOutput()
Returns the symbolic handle of a tensor.

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.