@@ -1278,7 +1278,8 @@ struct TORCH_API NumberType : public Type {
1278
1278
protected:
1279
1279
NumberType (TypeKind kind = TypeKind::NumberType) : Type(kind) {}
1280
1280
1281
- std::string annotation_str_impl (C10_UNUSED const TypePrinter& printer = nullptr ) const override {
1281
+ std::string annotation_str_impl (
1282
+ [[maybe_unused]] const TypePrinter& printer = nullptr ) const override {
1282
1283
return " number" ; // technically not a valid python type, but
1283
1284
// we need to use it when parsing back in annotations
1284
1285
// for implicit conversions
@@ -1305,7 +1306,8 @@ struct TORCH_API FloatType : public NumberType {
1305
1306
1306
1307
private:
1307
1308
FloatType () : NumberType(TypeKind::FloatType) {}
1308
- std::string annotation_str_impl (C10_UNUSED const TypePrinter& printer = nullptr ) const override {
1309
+ std::string annotation_str_impl (
1310
+ [[maybe_unused]] const TypePrinter& printer = nullptr ) const override {
1309
1311
return " float" ;
1310
1312
}
1311
1313
};
@@ -1330,7 +1332,8 @@ struct TORCH_API ComplexType : public NumberType {
1330
1332
1331
1333
private:
1332
1334
ComplexType () : NumberType(TypeKind::ComplexType) {}
1333
- std::string annotation_str_impl (C10_UNUSED const TypePrinter& printer = nullptr ) const override {
1335
+ std::string annotation_str_impl (
1336
+ [[maybe_unused]] const TypePrinter& printer = nullptr ) const override {
1334
1337
return " complex" ;
1335
1338
}
1336
1339
};
@@ -1419,7 +1422,8 @@ struct TORCH_API IntType : public NumberType {
1419
1422
1420
1423
private:
1421
1424
IntType () : NumberType(TypeKind::IntType) {}
1422
- std::string annotation_str_impl (C10_UNUSED const TypePrinter& printer = nullptr ) const override {
1425
+ std::string annotation_str_impl (
1426
+ [[maybe_unused]] const TypePrinter& printer = nullptr ) const override {
1423
1427
return " int" ;
1424
1428
}
1425
1429
};
@@ -1453,7 +1457,8 @@ struct TORCH_API StringType : public Type {
1453
1457
// we only use "str" (not "string") in both FunctionSchema and script
1454
1458
return annotation_str ();
1455
1459
}
1456
- std::string annotation_str_impl (C10_UNUSED const TypePrinter& printer = nullptr ) const override {
1460
+ std::string annotation_str_impl (
1461
+ [[maybe_unused]] const TypePrinter& printer = nullptr ) const override {
1457
1462
return " str" ;
1458
1463
}
1459
1464
static const TypeKind Kind = TypeKind::StringType;
@@ -1473,7 +1478,8 @@ struct TORCH_API StorageType : public Type {
1473
1478
std::string str () const override {
1474
1479
return annotation_str ();
1475
1480
}
1476
- std::string annotation_str_impl (C10_UNUSED const TypePrinter& printer = nullptr ) const override {
1481
+ std::string annotation_str_impl (
1482
+ [[maybe_unused]] const TypePrinter& printer = nullptr ) const override {
1477
1483
return " Storage" ;
1478
1484
}
1479
1485
static const TypeKind Kind = TypeKind::StorageType;
@@ -1508,7 +1514,8 @@ struct TORCH_API FunctionType : public NamedType {
1508
1514
1509
1515
private:
1510
1516
FunctionType (torch::jit::Function* function);
1511
- std::string annotation_str_impl (C10_UNUSED const TypePrinter& printer = nullptr ) const override {
1517
+ std::string annotation_str_impl (
1518
+ [[maybe_unused]] const TypePrinter& printer = nullptr ) const override {
1512
1519
const auto & n = name ().value ();
1513
1520
return n.qualifiedName ();
1514
1521
}
@@ -2199,7 +2206,8 @@ struct TORCH_API InterfaceType : public NamedType {
2199
2206
const InterfaceType& rhs,
2200
2207
std::ostream* why_not);
2201
2208
2202
- std::string annotation_str_impl (C10_UNUSED const TypePrinter& printer = nullptr ) const override {
2209
+ std::string annotation_str_impl (
2210
+ [[maybe_unused]] const TypePrinter& printer = nullptr ) const override {
2203
2211
return name ()->qualifiedName ();
2204
2212
}
2205
2213
0 commit comments