Caffe2 - C++ API
A deep learning, cross platform ML framework
Scalar.cpp
1 #include <c10/core/Scalar.h>
2 
3 namespace c10 {
4 
5 Scalar Scalar::operator-() const {
6  if (isFloatingPoint()) {
7  return Scalar(-v.d);
8  } else if (isComplex()) {
9  return Scalar(std::complex<double>(-v.z[0], -v.z[1]));
10  } else {
11  return Scalar(-v.i);
12  }
13 }
14 
15 } // namespace c10
To register your own kernel for an operator, do in one (!) cpp file: C10_REGISTER_KERNEL(OperatorHand...
Definition: alias_info.h:7