Skip to content

Commit ad358b9

Browse files
Update on "Add section to serialization note re weights_only"
[ghstack-poisoned]
2 parents 79a58fa + da923eb commit ad358b9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/source/notes/serialization.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ some types might be built dynamically during the unpickling process and hence wi
273273
:func:`torch.serialization.get_unsafe_globals_in_checkpoint` you might see an error like
274274

275275
.. code::
276+
276277
WeightsUnpickler error: Can only build Tensor, Parameter, OrderedDict or types allowlisted via `add_safe_globals`,
277278
but got <class 'numpy.dtype[float32]'>
278279
@@ -281,6 +282,7 @@ This can be allowlisted via ``{add_}safe_globals([type(np.dtype(np.float32))])``
281282
In ``numpy >=1.25`` you would see
282283

283284
.. code::
285+
284286
WeightsUnpickler error: Can only build Tensor, Parameter, OrderedDict or types allowlisted via `add_safe_globals`,
285287
but got <class 'numpy.dtypes.Float32DType'>
286288

0 commit comments

Comments
 (0)