Skip to content

Add pyre-ignore for Future instantiation in common.py and basic_models.py#1708

Open
vivekmig wants to merge 4 commits intometa-pytorch:masterfrom
vivekmig:export-D89870780
Open

Add pyre-ignore for Future instantiation in common.py and basic_models.py#1708
vivekmig wants to merge 4 commits intometa-pytorch:masterfrom
vivekmig:export-D89870780

Conversation

@vivekmig
Copy link
Contributor

Summary:
Pyre reports Call error [29]: typing.Type[Future] is not a function when instantiating torch.futures.Future() because the type stubs declare it as a generic type rather than a callable class.

Added pyre-ignore[29] comments to suppress these false positives since Future is callable at runtime. This affects:

  • _construct_future_forward in common.py
  • BasicModel_MultiLayer_with_Future.forward in basic_models.py

Differential Revision: D89870780

Vivek Miglani added 4 commits December 28, 2025 15:29
Summary:

Reenabling OSS type checking step, skipping pyre check but keeping original mypy checks

Pyre issues will be fixed in a stacked diff

Differential Revision: D89819451
…1706)

Summary:

The `cast()` calls in the `step_sizes` and `alphas` functions within `gauss_legendre_builders()` were flagged as redundant by Pyre type checker since the values being cast are already of type `np.ndarray`.  Replaced the inline cast pattern with explicit typed variable assignments.

Differential Revision: D89871122
Summary:

The `pyre-ignore[16]` comment for `np.core.multiarray._reconstruct` was no longer suppressing any type errors and Pyre flagged it as an unused ignore.

Removed the obsolete comment while keeping the `type: ignore[attr-defined]` for mypy compatibility.

Differential Revision: D89870752
…s.py

Summary:
Pyre reports `Call error [29]: typing.Type[Future] is not a function` when instantiating `torch.futures.Future()` because the type stubs declare it as a generic type rather than a callable class.

Added `pyre-ignore[29]` comments to suppress these false positives since `Future` is callable at runtime. This affects:
- `_construct_future_forward` in common.py
- `BasicModel_MultiLayer_with_Future.forward` in basic_models.py

Differential Revision: D89870780
@meta-cla meta-cla bot added the cla signed label Dec 28, 2025
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Dec 28, 2025

@vivekmig has exported this pull request. If you are a Meta employee, you can view the originating Diff in D89870780.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant