File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ namespace pyapi {
18
18
}
19
19
20
20
// TODO: Make this error message more informative
21
- #define ADD_ENUM_GET_SET (field_name, type, max_val ) \
22
- void set_##field_name(int64_t val) { \
23
- TRTORCH_CHECK (val < max_val, " Invalid enum value for field" ); \
24
- field_name = static_cast <type>(val); \
25
- } \
26
- int64_t get_##field_name() { \
27
- return static_cast <int64_t >(field_name); \
21
+ #define ADD_ENUM_GET_SET (field_name, type, max_val ) \
22
+ void set_##field_name(int64_t val) { \
23
+ TRTORCH_CHECK (val >= 0 && val <= max_val, " Invalid enum value for field" ); \
24
+ field_name = static_cast <type>(val); \
25
+ } \
26
+ int64_t get_##field_name() { \
27
+ return static_cast <int64_t >(field_name); \
28
28
}
29
29
30
30
struct InputRange : torch::CustomClassHolder {
You can’t perform that action at this time.
0 commit comments