Skip to content

Commit 4945579

Browse files
generatedunixname89002005287564facebook-github-bot
authored andcommitted
Remove default typing argument in PACKAGE file] [batch:20/511] [shard:5/N]
Reviewed By: MaggieMoss Differential Revision: D64659584 fbshipit-source-id: 3dcc9da20b3f52d652928ce3ace39327b1a7fc83
1 parent 26eb163 commit 4945579

File tree

4 files changed

+0
-11
lines changed

4 files changed

+0
-11
lines changed

tests/test_memoryview_stream.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
class MemoryviewStreamTest(unittest.TestCase):
1818
def test_memoryview_stream(self) -> None:
1919
tensor = torch.rand(1000)
20-
# pyre-fixme[6]: For 1st argument expected `Buffer` but got `ndarray[Any, Any]`.
2120
mv = memoryview(tensor.numpy()).cast("b")
2221
self.assertEqual(len(mv), 4000)
2322

tests/test_snapshot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ def test_app_state_with_primitive_types(tmp_path: Path) -> None:
180180
bytes_key=None,
181181
)
182182

183-
# pyre-fixme[53]: Captured variable `snapshot` is not annotated.
184183
def _assert_primitive_entry_with_type(
185184
location_key: str, expected_type_name: str
186185
) -> None:

torchsnapshot/memoryview_stream.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313

1414
# pyre-fixme[13]: Attribute `write` is never initialized.
1515
class MemoryviewStream(io.IOBase):
16-
# pyre-fixme[24]: Generic type `memoryview` expects 1 type parameter.
1716
def __init__(self, mv: memoryview) -> None:
18-
# pyre-fixme[24]: Generic type `memoryview` expects 1 type parameter.
1917
self._mv: memoryview = mv.cast("b")
2018
self._pos = 0
2119

22-
# pyre-fixme[24]: Generic type `memoryview` expects 1 type parameter.
2320
def read(self, size: Optional[int] = -1) -> memoryview:
2421
if self.closed:
2522
raise ValueError("read from closed file")
@@ -41,7 +38,6 @@ def read(self, size: Optional[int] = -1) -> memoryview:
4138
self._pos = newpos
4239
return b
4340

44-
# pyre-fixme[24]: Generic type `memoryview` expects 1 type parameter.
4541
def read1(self, size: int = -1) -> memoryview:
4642
"""This is the same as read."""
4743
return self.read(size)

torchsnapshot/serialization.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ class Serializer(Enum):
173173
]
174174

175175

176-
# pyre-fixme[24]: Generic type `memoryview` expects 1 type parameter.
177176
def tensor_as_memoryview(tensor: torch.Tensor) -> memoryview:
178177
"""
179178
Obtain the class::`memoryview` of a class::`torch.Tensor`.
@@ -200,11 +199,9 @@ def tensor_as_memoryview(tensor: torch.Tensor) -> memoryview:
200199
tensor = tensor.contiguous()
201200
if tensor.dtype == torch.bfloat16:
202201
return _tensor_as_memoryview_via_untyped_storage(tensor)
203-
# pyre-fixme[6]: For 1st argument expected `Buffer` but got `ndarray[Any, Any]`.
204202
return memoryview(tensor.numpy()).cast("b")
205203

206204

207-
# pyre-fixme[24]: Generic type `memoryview` expects 1 type parameter.
208205
def _tensor_as_memoryview_via_untyped_storage(tensor: torch.Tensor) -> memoryview:
209206
"""
210207
Obtain the class::`memoryview` of a class::`torch.Tensor` via untyped storage.
@@ -226,7 +223,6 @@ def _tensor_as_memoryview_via_untyped_storage(tensor: torch.Tensor) -> memoryvie
226223
untyped_storage = contiguous_view_as_untyped_storage(tensor)
227224
tensor = torch.empty((0))
228225
tensor.set_(untyped_storage)
229-
# pyre-fixme[6]: For 1st argument expected `Buffer` but got `ndarray[Any, Any]`.
230226
return memoryview(tensor.numpy()).cast("b")
231227

232228

@@ -253,7 +249,6 @@ def contiguous_view_as_untyped_storage(tensor: torch.Tensor) -> UntypedStorage:
253249

254250

255251
def tensor_from_memoryview(
256-
# pyre-fixme[24]: Generic type `memoryview` expects 1 type parameter.
257252
mv: memoryview,
258253
dtype: torch.dtype,
259254
shape: List[int],

0 commit comments

Comments
 (0)