mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[Codemod][FBSourceBlackLinter] Daily arc lint --take BLACK
Reviewed By: zertosh Differential Revision: D31423202 fbshipit-source-id: 08d249e8546c0bfe6f1145c0571141b90aad03eb
This commit is contained in:

committed by
Facebook GitHub Bot
parent
d1058df885
commit
cbc29acca3
@ -1,8 +1,9 @@
|
||||
import os.path
|
||||
from glob import glob
|
||||
from typing import cast
|
||||
from torch.types import Storage
|
||||
|
||||
import torch
|
||||
from torch.types import Storage
|
||||
|
||||
# because get_storage_from_record returns a tensor!?
|
||||
class _HasStorage(object):
|
||||
|
@ -18,12 +18,12 @@ from typing import (
|
||||
Sequence,
|
||||
Set,
|
||||
Union,
|
||||
cast
|
||||
cast,
|
||||
)
|
||||
from torch.types import Storage
|
||||
|
||||
import torch
|
||||
from torch.serialization import location_tag, normalize_storage_type
|
||||
from torch.types import Storage
|
||||
from torch.utils.hooks import RemovableHandle
|
||||
|
||||
from ._digraph import DiGraph
|
||||
@ -800,7 +800,6 @@ class PackageExporter:
|
||||
dtype = obj.dtype
|
||||
storage_numel = obj.size()
|
||||
|
||||
|
||||
else:
|
||||
storage = obj
|
||||
storage_type = normalize_storage_type(type(storage))
|
||||
|
@ -219,8 +219,8 @@ class PackageImporter(Importer):
|
||||
# TODO: Once we decide to break serialization FC, we can
|
||||
# stop wrapping with TypedStorage
|
||||
return torch.storage.TypedStorage(
|
||||
wrap_storage=storage._untyped(),
|
||||
dtype=dtype)
|
||||
wrap_storage=storage._untyped(), dtype=dtype
|
||||
)
|
||||
elif typename == "reduce_package":
|
||||
# to fix BC breaking change, objects on this load path
|
||||
# will be loaded multiple times erroneously
|
||||
|
Reference in New Issue
Block a user