max method
Calculates element-wise maximum of the two tensors.
Element i
is calculated with the formula:
x[i] = max(x[i], right[i]);
Throws ArgumentError if tensor shapes are not equal.
Implementation
@override
void max(Tensor<double> right) {
_checkSameShape(right);
final elements = this.elements;
final rightElements = right.elements;
final n = length;
for (var i = 0; i < n; i++) {
elements[i] = math.max(elements[i], rightElements[i]);
}
}