Fix formatting problems. (#11980)
This commit is contained in:
parent
17923f4987
commit
f76adbce27
@ -178,9 +178,7 @@ suggested implementation is to:
|
|||||||
file, but the specialization for the GPUDevice is defined in a .cu.cc file,
|
file, but the specialization for the GPUDevice is defined in a .cu.cc file,
|
||||||
since it will be compiled with the CUDA compiler.
|
since it will be compiled with the CUDA compiler.
|
||||||
|
|
||||||
<!--zippy-->
|
Here is an example implementation.
|
||||||
|
|
||||||
Expand this to see the example implementation.
|
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
// example.h
|
// example.h
|
||||||
@ -307,8 +305,6 @@ template struct ExampleFunctor<GPUDevice, int32>;
|
|||||||
#endif // GOOGLE_CUDA
|
#endif // GOOGLE_CUDA
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--endzippy-->
|
|
||||||
|
|
||||||
## Build the op library
|
## Build the op library
|
||||||
### Compile the op using your system compiler (TensorFlow binary installation)
|
### Compile the op using your system compiler (TensorFlow binary installation)
|
||||||
|
|
||||||
@ -763,7 +759,7 @@ Your op registration now specifies that the input's type must be `float`, or
|
|||||||
> """
|
> """
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
<pre><pre class="prettyprint"><code class="lang-cpp">
|
<pre class="prettyprint"><code class="lang-cpp">
|
||||||
\#include "tensorflow/core/framework/op_kernel.h"<br/>
|
\#include "tensorflow/core/framework/op_kernel.h"<br/>
|
||||||
class ZeroOut<b>Int32</b>Op : public OpKernel {
|
class ZeroOut<b>Int32</b>Op : public OpKernel {
|
||||||
// as before
|
// as before
|
||||||
@ -803,7 +799,7 @@ REGISTER\_KERNEL\_BUILDER(
|
|||||||
.Device(DEVICE\_CPU)
|
.Device(DEVICE\_CPU)
|
||||||
.TypeConstraint<float>("T"),
|
.TypeConstraint<float>("T"),
|
||||||
ZeroOutFloatOp);
|
ZeroOutFloatOp);
|
||||||
</b></code></pre></pre>
|
</b></code></pre>
|
||||||
|
|
||||||
> To preserve [backwards compatibility](#backwards-compatibility), you should
|
> To preserve [backwards compatibility](#backwards-compatibility), you should
|
||||||
> specify a [default value](#default-values-constraints) when adding an attr to
|
> specify a [default value](#default-values-constraints) when adding an attr to
|
||||||
|
Loading…
Reference in New Issue
Block a user