aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/java/src/gen/cc/op_generator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/java/src/gen/cc/op_generator.cc')
-rw-r--r--tensorflow/java/src/gen/cc/op_generator.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/tensorflow/java/src/gen/cc/op_generator.cc b/tensorflow/java/src/gen/cc/op_generator.cc
index 9b171f66ec..d5bd99bdd9 100644
--- a/tensorflow/java/src/gen/cc/op_generator.cc
+++ b/tensorflow/java/src/gen/cc/op_generator.cc
@@ -35,7 +35,7 @@ namespace tensorflow {
namespace java {
namespace {
-const char* kLicense =
+constexpr const char kLicense[] =
"/* Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n"
"\n"
"Licensed under the Apache License, Version 2.0 (the \"License\");\n"
@@ -391,9 +391,12 @@ void GenerateOp(const OpSpec& op, const EndpointSpec& endpoint,
}
if (!op.hidden()) {
// expose the op in the Ops Graph API only if it is visible
- op_class.add_annotation(
- Annotation::Create("Operator", "org.tensorflow.op.annotation")
- .attributes("group = \"" + endpoint.package() + "\""));
+ Annotation oper_annot =
+ Annotation::Create("Operator", "org.tensorflow.op.annotation");
+ if (endpoint.package() != kDefaultEndpointPackage) {
+ oper_annot.attributes("group = \"" + endpoint.package() + "\"");
+ }
+ op_class.add_annotation(oper_annot);
}
// create op class file
const string op_dir_name = io::JoinPath(