Created
June 19, 2019 04:24
-
-
Save ivelin/ca00faf00b44ac537d4faddde3fc23f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "tensorflow/core/framework/common_shape_fns.h" | |
#include "tensorflow/core/framework/op.h" | |
#include "tensorflow/core/framework/shape_inference.h" | |
namespace tensorflow { | |
REGISTER_OP("PcapInput") | |
.Input("source: string") | |
.Output("handle: variant") | |
.Attr("filters: list(string) = []") | |
.Attr("columns: list(string) = []") | |
.Attr("schema: string = ''") | |
.SetShapeFn([](shape_inference::InferenceContext* c) { | |
c->set_output(0, c->MakeShape({c->UnknownDim()})); | |
return Status::OK(); | |
}); | |
REGISTER_OP("PcapDataset") | |
.Input("input: T") | |
.Input("batch: int64") | |
.Output("handle: variant") | |
.Attr("output_types: list(type) >= 1") | |
.Attr("output_shapes: list(shape) >= 1") | |
.Attr("T: {string, variant} = DT_VARIANT") | |
.SetIsStateful() | |
.SetShapeFn([](shape_inference::InferenceContext* c) { | |
c->set_output(0, c->MakeShape({})); | |
return Status::OK(); | |
}); | |
} // namespace tensorflow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment