mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Update (base update)
[ghstack-poisoned]
This commit is contained in:
parent
8324795078
commit
063cdcfbf7
2 changed files with 5 additions and 8 deletions
|
|
@ -1340,11 +1340,7 @@ def load(
|
|||
... weights_only=True,
|
||||
... ) # type: ignore[attr-defined]
|
||||
# Map tensors from GPU 1 to GPU 0
|
||||
>>> torch.load(
|
||||
... "tensors.pt",
|
||||
... map_location={"cuda:1": "cuda:0"},
|
||||
... weights_only=True,
|
||||
... )
|
||||
>>> torch.load("tensors.pt", map_location={"cuda:1": "cuda:0"}, weights_only=True)
|
||||
# Load tensor from io.BytesIO object
|
||||
# Loading from a buffer setting weights_only=False, warning this can be unsafe
|
||||
>>> with open("tensor.pt", "rb") as f:
|
||||
|
|
|
|||
|
|
@ -39,9 +39,10 @@ def use_const_ref_for_mutable_tensors() -> bool:
|
|||
|
||||
|
||||
def use_ilistref_for_tensor_lists() -> bool:
|
||||
assert (
|
||||
_locals.use_ilistref_for_tensor_lists is not None
|
||||
), "need to initialize local.use_ilistref_for_tensor_lists with local.parametrize"
|
||||
assert _locals.use_ilistref_for_tensor_lists is not None, (
|
||||
"need to initialize local.use_ilistref_for_tensor_lists with "
|
||||
"local.parametrize"
|
||||
)
|
||||
return _locals.use_ilistref_for_tensor_lists
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue