torch.Tensor.Tensor.maximum
Tensor.maximum<O extends Shape>(other: Tensor<O>): Tensor<DynamicShape, D, Dev>Computes the element-wise maximum of this tensor and another tensor.
This operation supports broadcasting - if the tensors have different shapes, they will be broadcast to a compatible shape.
Parameters
otherTensor<O>- The tensor to compare against
Returns
Tensor<DynamicShape, D, Dev>– A tensor containing the element-wise maximum valuesExamples
const a = torch.tensor([1, 5, 3]);
const b = torch.tensor([2, 4, 6]);
const result = a.maximum(b);
// result: [2, 5, 6]