Usually `OpProtoMaker` and `Op`'s type definitions are written in `.cc` files, which also include the registration methods introduced later.
Usually `OpProtoMaker` and `Op`'s type definitions are written in `.cc` files, which also include the registration methods introduced later.
### 3. Defining OpKernel
### Defining OpKernel
`MulKernel` inherits `framework::OpKernel`, which includes the following templates:
`MulKernel` inherits `framework::OpKernel`, which includes the following templates:
...
@@ -188,7 +188,7 @@ This concludes the forward implementation of an operator. Next its operation and
...
@@ -188,7 +188,7 @@ This concludes the forward implementation of an operator. Next its operation and
The definition of its corresponding backward operator, if applicable, is similar to that of an forward operator. **Note that a backward operator does not include a `ProtoMaker`**.
The definition of its corresponding backward operator, if applicable, is similar to that of an forward operator. **Note that a backward operator does not include a `ProtoMaker`**.
### 4. Registering Operator
### Registering Operator
- In `.cc` files, register forward and backward operator classes and the CPU kernel.
- In `.cc` files, register forward and backward operator classes and the CPU kernel.
...
@@ -220,7 +220,7 @@ The definition of its corresponding backward operator, if applicable, is similar
...
@@ -220,7 +220,7 @@ The definition of its corresponding backward operator, if applicable, is similar