Skip to content

Commit 12fbb17

Browse files
stroxlermeta-codesync[bot]
authored andcommitted
Explain tensor-shape diagnostics in basic mode
Summary: Make clear that resolving the shape stubs enables inference but does not override Pyrefly's diagnostic preset. The unconfigured IDE's `basic` fallback still provides inferred shapes and inlay hints while suppressing all tensor-shape errors, so the setup now points users to project initialization or a fuller IDE mode. ___ landed-with-radar-review Differential Revision: D125223855 fbshipit-source-id: 8f69c8babfb0b7397cc3d030435011c504605e82
1 parent 6ea1442 commit 12fbb17

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

‎website/docs/tensor-shapes-setup.mdx‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,26 @@ your project can choose the runtime library versions it needs.
5959
`Int` — the bridge between runtime integer values and type-level symbols — and
6060
other runtime helpers used by shape annotations.
6161

62-
Tensor shape support is enabled automatically when Pyrefly can resolve the
63-
`shape_extensions` package, so nothing else needs configuring, as long as
64-
Pyrefly resolves imports against the
62+
Tensor shape inference is enabled automatically when Pyrefly can resolve the
63+
`shape_extensions` package, so there is no tensor-shape-specific flag to set.
64+
Pyrefly must resolve imports against the
6565
[Python environment](../configuration#python-interpreter-path) you installed
6666
into.
6767

68+
:::note Shape errors are hidden in basic mode
69+
When the IDE finds no Pyrefly configuration or migratable mypy or Pyright
70+
configuration, its default `auto` mode falls back to the
71+
[`basic` preset](../configuration#preset-basic). Basic mode still computes
72+
shapes and provides inferred types and inlay hints, but it suppresses every
73+
tensor-shape diagnostic. Installing the stubs alone therefore does not show
74+
shape errors in this mode.
75+
76+
Run `pyrefly init` to create a project configuration (and migrate any existing
77+
type-checker settings), or set
78+
[`python.pyrefly.typeCheckingMode`](../IDE#pythonpyreflytypecheckingmode) to
79+
`default` or `strict` for unconfigured files.
80+
::::
81+
6882
### Checking against a local copy of the stubs
6983

7084
The stubs also live in Pyrefly's source tree under

0 commit comments

Comments
 (0)