tensorflow/compiler/mlir/tensorflow/translate/derived_attr_populator_gen.cc
// Emits TensorFlow derived attribute name collector functions for each of the
// ops.
Emits TensorFlow derived attribute name collector functions for each of the
ops.
Emits TensorFlow derived attribute name collector functions for each of the ops .
static void EmitOpAttrNameCollector(const std::vector<Operator> &ops,
                                    raw_ostream *ostream) {
  raw_ostream &os = *ostream;
  for (const auto &op : ops) {
    auto op_name = op.getCppClassName();
    OUT(0) << "static void Collect" << op_name
           << "DerivedAttrsName(mlir::TF::" << op_name
           << "& op, llvm::SmallDenseSet<llvm::StringRef>* values) {\n";
    for (const auto &named_attr : op.getAttributes()) {
      auto attr_name = named_attr.name;
      const auto &attr = named_attr.attr;
      if (!attr.isDerivedAttr()) continue;
      OUT(2) << "values->insert(\"" << attr_name << "\");\n";
    }
    OUT(2) << "return;\n";
    OUT(0) << "}\n\n";
  }
}
static void EmitOpAttrNameCollector ( const std :: vector < Operator > & ops , raw_ostream * ostream ) { raw_ostream & os = * ostream ; for ( const auto & op : ops ) { auto op_name = op . getCppClassName ( ) ; OUT ( 0 ) << " " << op_name << " " << op_name << " \n " ; for ( const auto & named_attr : op . getAttributes ( ) ) { auto attr_name = named_attr . name ; const auto & attr = named_attr . attr ; if ( ! attr . isDerivedAttr ( ) ) continue ; OUT ( 2 ) << " \" " << attr_name << " \" \n " ; } OUT ( 2 ) << " \n " ; OUT ( 0 ) << " \n \n " ; } }
Emits TensorFlow derived attribute name collector functions for each of the
ops.
Emits TensorFlow derived attribute name collector functions for each of the ops .
// Emit function signature. // Insert the name for each derived attribute in the set.