mulScalar method Null safety

Tensor mulScalar(
  1. num s
)

Multiplies tensor elements with a scalar.

The formula for result element i is:

s * elements[i];

Throws ArgumentError if tensor shapes are not equal.

Implementation

Tensor mulScalar(num s) {
  final builder = toBuilder();
  builder.mulScalar(s);
  return builder.build();
}