<p>We first obtain the computing handle from a concrete DeviceContext, and then compute on tensors.</p>
<p>The implemention of <codeclass="docutils literal"><spanclass="pre">OpKernel</span></code> is similar to math functors, the extra thing we need to do is to register the OpKernel in a global map.</p>
<p>We first obtain the computing handle from a concrete DeviceContext and then compute on tensors.</p>
<p>The implementation of <codeclass="docutils literal"><spanclass="pre">OpKernel</span></code> is similar to math functors, the extra thing we need to do is to register the OpKernel in a global map.</p>
<p>Fluid provides different register interfaces in op_registry.h</p>
<p>Let’s take <aclass="reference external"href="https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/operators/crop_op.cc#L134">Crop</a> operator as an example:</p>
<p>We first obtain the computing handle from a concrete DeviceContext, and then compute on tensors.</p>
<p>The implemention of <codeclass="docutils literal"><spanclass="pre">OpKernel</span></code> is similar to math functors, the extra thing we need to do is to register the OpKernel in a global map.</p>
<p>We first obtain the computing handle from a concrete DeviceContext and then compute on tensors.</p>
<p>The implementation of <codeclass="docutils literal"><spanclass="pre">OpKernel</span></code> is similar to math functors, the extra thing we need to do is to register the OpKernel in a global map.</p>
<p>Fluid provides different register interfaces in op_registry.h</p>
<p>Let’s take <aclass="reference external"href="https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/operators/crop_op.cc#L134">Crop</a> operator as an example:</p>