You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix mypy errors from convert_to_tensor → as_tensor swap
The new `img.as_tensor() if isinstance(img, MetaTensor) else cast(...)`
expression narrowed mypy's inference of `img_t` to `Tensor`, so downstream
reassignments from `_clip` / `_normalize` / `interp` (which return
`NdarrayOrTensor`) failed type-checking. Annotate `img_t` explicitly as
`NdarrayOrTensor` and drop the redundant `cast(torch.Tensor, img)` so the
variable matches the type used by the rest of each transform's body.
Keep the `cast` only on `SavitzkyGolaySmooth.__call__` where `self.img_t`
is declared as `torch.Tensor` in `__init__` and used unconditionally as a
Tensor afterwards.
Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
0 commit comments