tensorflow/compiler/mlir/tensorflow/ir/tf_ops.cc
Type TensorFlowDialect::parseType(DialectAsmParser &parser) const {
  StringRef data;
  if (parser.parseKeyword(&data)) return Type();

  Location loc = parser.getEncodedSourceLoc(parser.getNameLoc());
  auto typeKind = llvm::StringSwitch<unsigned>(data)
#define HANDLE_TF_TYPE(tftype, enumerant, name) \
  .Case(name, TensorFlowTypes::enumerant)
// Custom TensorFlow types are handled separately at the end as they do partial
// match.
#define HANDLE_CUSTOM_TF_TYPE(tftype, enumerant, name)
// NOLINTNEXTLINE
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_types.def"
                      .StartsWith("resource", TensorFlowTypes::RESOURCE)
                      .StartsWith("variant", TensorFlowTypes::VARIANT)
                      .Default(0);
  switch (typeKind) {
    default:
      return (emitError(loc, "unknown TensorFlow type: " + data), nullptr);

#define HANDLE_TF_TYPE(tftype, enumerant, name) \
  case TensorFlowTypes::enumerant:              \
    return tftype##Type::get(getContext());
#define HANDLE_CUSTOM_TF_TYPE(tftype, enumerant, name)
// NOLINTNEXTLINE
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_types.def"
    case TensorFlowTypes::RESOURCE:
      return ParseResourceType(parser, loc);
    case TensorFlowTypes::VARIANT:
      return ParseVariantType(parser, loc);
  }
}
// Parses a type registered to this dialect.
Parses a type registered to this dialect.
Parses a type registered to this dialect .
Type TensorFlowDialect::parseType(DialectAsmParser &parser) const {
  StringRef data;
  if (parser.parseKeyword(&data)) return Type();
  Location loc = parser.getEncodedSourceLoc(parser.getNameLoc());
  auto typeKind = llvm::StringSwitch<unsigned>(data)
#define HANDLE_TF_TYPE(tftype, enumerant, name) \
  .Case(name, TensorFlowTypes::enumerant)
#define HANDLE_CUSTOM_TF_TYPE(tftype, enumerant, name)
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_types.def"
                      .StartsWith("resource", TensorFlowTypes::RESOURCE)
                      .StartsWith("variant", TensorFlowTypes::VARIANT)
                      .Default(0);
  switch (typeKind) {
    default:
      return (emitError(loc, "unknown TensorFlow type: " + data), nullptr);
#define HANDLE_TF_TYPE(tftype, enumerant, name) \
  case TensorFlowTypes::enumerant:              \
    return tftype##Type::get(getContext());
#define HANDLE_CUSTOM_TF_TYPE(tftype, enumerant, name)
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_types.def"
    case TensorFlowTypes::RESOURCE:
      return ParseResourceType(parser, loc);
    case TensorFlowTypes::VARIANT:
      return ParseVariantType(parser, loc);
  }
}
Type TensorFlowDialect :: parseType ( DialectAsmParser & parser ) const { StringRef data ; if ( parser . parseKeyword ( & data ) ) return Type ( ) ; Location loc = parser . getEncodedSourceLoc ( parser . getNameLoc ( ) ) ; auto typeKind = llvm :: StringSwitch < unsigned > ( data ) #define HANDLE_TF_TYPE ( tftype , enumerant , name )  \
  .Case(name, TensorFlowTypes::enumerant) #define HANDLE_CUSTOM_TF_TYPE ( tftype , enumerant , name ) #include " " . StartsWith ( " " , TensorFlowTypes :: RESOURCE ) . StartsWith ( " " , TensorFlowTypes :: VARIANT ) . Default ( 0 ) ; switch ( typeKind ) { default : return ( emitError ( loc , " " + data ) , nullptr ) ; #define HANDLE_TF_TYPE ( tftype , enumerant , name )  \
  case TensorFlowTypes::enumerant:              \
    return tftype##Type::get(getContext()); #define HANDLE_CUSTOM_TF_TYPE ( tftype , enumerant , name ) #include " " case TensorFlowTypes :: RESOURCE : return ParseResourceType ( parser , loc ) ; case TensorFlowTypes :: VARIANT : return ParseVariantType ( parser , loc ) ; } }
Parses a type registered to this dialect.
Parses a type registered to this dialect .
// Custom TensorFlow types are handled separately at the end as they do partial // match. // NOLINTNEXTLINE // NOLINTNEXTLINE