Skip to content

Commit 87bc175

Browse files
Create zero_out.cpp
1 parent 14b395b commit 87bc175

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

zero_out.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "tensorflow/core/framework/op.h"
2+
#include "tensorflow/core/framework/shape_inference.h"
3+
4+
using namespace tensorflow;
5+
6+
REGISTER_OP("ZeroOut")
7+
.Input("to_zero: int32")
8+
.Output("zeroed: int32")
9+
.SetShapeFn([](::tensorflow::shape_inference::InferenceContext* c) {
10+
c->set_output(0, c->input(0));
11+
return Status::OK();
12+
});

0 commit comments

Comments
 (0)