operator unary- method

Tensor<T> operator unary-()

Calculates scale(-1.0).

The formula for result element i is result[i] = -this[i].

The returned tensor will have identical type and tensorShape.

Implementation

Tensor<T> operator -() {
  final builder = toBuilder();
  builder.neg();
  return builder.build();
}