div method Null safety

Tensor<T> div(
  1. Tensor<T> right,
  2. {bool noNan = false}
)

Calculates element-wise fraction.

The formula for result element i is:

elements[i] / right.elements[i];

Throws ArgumentError if tensor shapes are not equal.

Implementation

Tensor<T> div(
  Tensor<T> right, {
  bool noNan = false,
}) {
  final builder = toBuilder();
  builder.div(right, noNan: noNan);
  return builder.build();
}