Skip to content
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

Cleanup of type issues in models/model_utils #3251

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

esantorella
Copy link
Contributor

Summary: A TypeVar indicates that multiple objects (e.g. an argument and a return type) are the same type. Using TypeVars with functions that work with either numpy arrays or torch tensors indicates that either everything is a numpy array or everything is a tensor. Otherwise, Pyre has no idea whether arrays might be randomly turning into tensors and vice versa.

Differential Revision: D68332888

Summary: A `TypeVar` indicates that multiple objects (e.g. an argument and a return type) are the same type. Using `TypeVar`s with functions that work with either numpy arrays or torch tensors indicates that either everything is a numpy array or everything is a tensor. Otherwise, Pyre has no idea whether arrays might be randomly turning into tensors and vice versa.

Differential Revision: D68332888
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 17, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68332888

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.88%. Comparing base (81fba5c) to head (d2eb27c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3251      +/-   ##
==========================================
- Coverage   95.88%   95.88%   -0.01%     
==========================================
  Files         513      513              
  Lines       51689    51687       -2     
==========================================
- Hits        49562    49560       -2     
  Misses       2127     2127              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants