diff options
author | karl@kubx.ca <karl@kubx.ca> | 2018-05-05 10:44:20 -0400 |
---|---|---|
committer | karl@kubx.ca <karl@kubx.ca> | 2018-05-05 10:44:20 -0400 |
commit | c92de2f3fc81c701ab29408a8a84cd6e41e96fe5 (patch) | |
tree | 45d013825b4bd40cbab4d565ce5de8cf3165d949 /tensorflow/java/src | |
parent | dd1ef8fa8f6861e53e8a7953c171b3e9253043ed (diff) |
Skip all ops with function attribute by default
Diffstat (limited to 'tensorflow/java/src')
-rw-r--r-- | tensorflow/java/src/gen/cc/op_generator.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tensorflow/java/src/gen/cc/op_generator.cc b/tensorflow/java/src/gen/cc/op_generator.cc index 7355b3a395..f4cefbe933 100644 --- a/tensorflow/java/src/gen/cc/op_generator.cc +++ b/tensorflow/java/src/gen/cc/op_generator.cc @@ -420,6 +420,18 @@ void GenerateOp(const OpSpec& op, const EndpointSpec& endpoint, writer.EndType(); } +bool CanGenerateOp(const OpDef& op_def, const ApiDef& api_def) { + if (api_def.visibility() == ApiDef::SKIP) { + return false; + } + for (const auto& attr : op_def.attr()) { + if (attr.type() == "func") { + return false; // TODO(karllessard) add support for function attributes + } + } + return true; +} + } // namespace Status OpGenerator::Run(const OpList& op_list, const string& base_package, @@ -441,7 +453,7 @@ Status OpGenerator::Run(const OpList& op_list, const string& base_package, api_map.UpdateDocs(); for (const auto& op_def : op_list.op()) { const ApiDef* api_def = api_map.GetApiDef(op_def.name()); - if (api_def->visibility() != ApiDef::SKIP) { + if (CanGenerateOp(op_def, *api_def)) { OpSpec op(OpSpec::Create(op_def, *api_def)); for (const EndpointSpec& endpoint : op.endpoints()) { GenerateOp(op, endpoint, base_package, output_dir, env_); |