Remove a few more comments I missed in the last commit.

pull/222/head
Sean Silva 2021-06-14 16:00:54 -07:00
parent 6b2424512b
commit ea1dd1cd90
2 changed files with 0 additions and 13 deletions

View File

@ -44,12 +44,10 @@ MlirType npcompBasicpyBytesTypeGet(MlirContext context) {
// Dict type. // Dict type.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/** Checks whether the given type is the Python "dict" type. */
bool npcompTypeIsABasicpyDict(MlirType t) { bool npcompTypeIsABasicpyDict(MlirType t) {
return unwrap(t).isa<Basicpy::DictType>(); return unwrap(t).isa<Basicpy::DictType>();
} }
/** Gets the generic Python "dict" type. */
MlirType npcompBasicpyDictTypeGet(MlirContext context) { MlirType npcompBasicpyDictTypeGet(MlirContext context) {
return wrap(Basicpy::DictType::get(unwrap(context))); return wrap(Basicpy::DictType::get(unwrap(context)));
} }
@ -58,12 +56,10 @@ MlirType npcompBasicpyDictTypeGet(MlirContext context) {
// List type. // List type.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/** Checks whether the given type is the Python "list" type. */
bool npcompTypeIsABasicpyList(MlirType t) { bool npcompTypeIsABasicpyList(MlirType t) {
return unwrap(t).isa<Basicpy::ListType>(); return unwrap(t).isa<Basicpy::ListType>();
} }
/** Gets the generic Python "dict" type. */
MlirType npcompBasicpyListTypeGet(MlirContext context) { MlirType npcompBasicpyListTypeGet(MlirContext context) {
return wrap(Basicpy::ListType::get(unwrap(context))); return wrap(Basicpy::ListType::get(unwrap(context)));
} }
@ -72,12 +68,10 @@ MlirType npcompBasicpyListTypeGet(MlirContext context) {
// !basicpy.NoneType type. // !basicpy.NoneType type.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/** Checks whether the given type is a `!basicpy.NoneType`. */
bool npcompTypeIsANone(MlirType t) { bool npcompTypeIsANone(MlirType t) {
return unwrap(t).isa<Basicpy::NoneType>(); return unwrap(t).isa<Basicpy::NoneType>();
} }
/** Gets the `!basicpy.NoneType` type. */
MlirType npcompBasicpyNoneTypeGet(MlirContext context) { MlirType npcompBasicpyNoneTypeGet(MlirContext context) {
return wrap(Basicpy::NoneType::get(unwrap(context))); return wrap(Basicpy::NoneType::get(unwrap(context)));
} }
@ -104,13 +98,10 @@ MlirType npcompBasicPySlotObjectTypeGet(MlirContext context,
// Tuple type. // Tuple type.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/** Checks whether the given type is the special "any dtype" type that is used
* to signal an NDArray or tensor of unknown type. */
bool npcompTypeIsABasicpyTuple(MlirType t) { bool npcompTypeIsABasicpyTuple(MlirType t) {
return unwrap(t).isa<Basicpy::TupleType>(); return unwrap(t).isa<Basicpy::TupleType>();
} }
/** Gets the "any dtype" type. */
MlirType npcompBasicpyTupleTypeGet(MlirContext context) { MlirType npcompBasicpyTupleTypeGet(MlirContext context) {
return wrap(Basicpy::TupleType::get(unwrap(context))); return wrap(Basicpy::TupleType::get(unwrap(context)));
} }

View File

@ -20,12 +20,10 @@ using namespace mlir::NPCOMP;
// torch.nn.Module type. // torch.nn.Module type.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/** Checks whether the given type is a torch.nn.Module type */
bool npcompTypeIsATorchNnModule(MlirType t) { bool npcompTypeIsATorchNnModule(MlirType t) {
return unwrap(t).isa<Torch::NnModuleType>(); return unwrap(t).isa<Torch::NnModuleType>();
} }
/** Gets the torch.nn.Module type of the specified class. */
MlirType npcompTorchNnModuleTypeGet(MlirContext context, MlirType npcompTorchNnModuleTypeGet(MlirContext context,
MlirStringRef className) { MlirStringRef className) {
return wrap(Torch::NnModuleType::get(unwrap(context), unwrap(className))); return wrap(Torch::NnModuleType::get(unwrap(context), unwrap(className)));
@ -35,12 +33,10 @@ MlirType npcompTorchNnModuleTypeGet(MlirContext context,
// torch.optional type. // torch.optional type.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/** Checks whether the given type is a !torch.optional<T> type */
bool npcompTypeIsATorchOptional(MlirType t) { bool npcompTypeIsATorchOptional(MlirType t) {
return unwrap(t).isa<Torch::OptionalType>(); return unwrap(t).isa<Torch::OptionalType>();
} }
/** Gets the !torch.optional<T> type with subtype T. */
MlirType npcompTorchOptionalTypeGet(MlirType containedType) { MlirType npcompTorchOptionalTypeGet(MlirType containedType) {
return wrap(Torch::OptionalType::get(unwrap(containedType))); return wrap(Torch::OptionalType::get(unwrap(containedType)));
} }