clamp method Null safety

  1. @override
void clamp(
  1. double lowerLimit,
  2. double upperLimit
)
override

Clamps elements of this tensor.

Throws ArgumentError if tensor shapes are not equal.

Implementation

@override
void clamp(double lowerLimit, double upperLimit) {
  final elements = this.elements;
  final n = length;
  for (var i = 0; i < n; i++) {
    elements[i].clamp(lowerLimit, upperLimit);
  }
}