- 
                Notifications
    
You must be signed in to change notification settings  - Fork 3.7k
 
feat(relax/frontend/torch): Add basic range constraint support #17898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(relax/frontend/torch): Add basic range constraint support #17898
Conversation
| 
           done @mshr-h Please check if my implementation is up to expectation  | 
    
| 
           Understood @mshr-h I will fix it.  | 
    
| 
           @mshr-h I have made the changes requested by you  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the update! Please fix the CI errors so that we can merge it. @demoncoder-crypto
| 
           Tried to fix the errors do let me know if it works now thanks @mshr-h Edit - i also tried creating helper methods I don't know how to fix the lint error  | 
    
4145c11    to
    b66a89b      
    Compare
  
    | 
           I cannot fix the lint/pr-head its expecting less nesting which would require me to make a helper method should I proceed and make it? @mshr-h  | 
    
594a7e4    to
    30d49d8      
    Compare
  
    064f5d7    to
    dc4ebca      
    Compare
  
    dc4ebca    to
    5c7758c      
    Compare
  
    | 
               | 
          ||
| return parameters_buffers_constants, user_inputs, relax_range_constraints | ||
| 
               | 
          ||
| # NEW HELPER METHOD | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the unnecessary comment.
| return parameters_buffers_constants, user_inputs, relax_range_constraints | ||
| 
               | 
          ||
| # NEW HELPER METHOD | ||
| def _add_range_constraint(self, constraints_dict, relax_tir_var, min_val, max_val): | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@staticmethod would be better since it doesn't access the instance variable or method.
| 
           Adding helper functions is totally fine as long as it's readable and maintainable. @demoncoder-crypto  | 
    
| 
           I think we need multiple testcases so that we can cover all the possible cases: 
  | 
    
| 
           @demoncoder-crypto pls fix the conflicts and ci  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the CI error and resolve the conflict.
Addresses #17818