max method Null safety

Tensor<T> max(
  1. Tensor<T> right
)

Calculates element-wise maximum.

The formula for result element i is:

result[i] = max(elements[i], right.elements[i]);

Throws ArgumentError if tensor shapes are not equal.

Implementation

Tensor<T> max(Tensor<T> right) {
  final builder = toBuilder();
  builder.max(right);
  return builder.build();
}