| 28 | // One input and one output, both the same type. |
| 29 | template <class T> |
| 30 | class UnaryOp : public OpKernel { |
| 31 | public: |
| 32 | explicit UnaryOp(OpKernelConstruction* context) : OpKernel(context) { |
| 33 | const DataType dt = DataTypeToEnum<T>::v(); |
| 34 | OP_REQUIRES_OK(context, context->MatchSignature({dt}, {dt})); |
| 35 | } |
| 36 | }; |
| 37 | |
| 38 | // Two inputs and one output, all the same type. |
| 39 | template <class T> |