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
<spanclass="w"></span><spanclass="sa">r</span><spanclass="sd">"""Defines how to transform ``other`` when loading it into ``self`` in :meth:`~nn.Module.load_state_dict`.</span>
1198
1198
1199
1199
<spanclass="sd"> Used when :func:`~torch.__future__.get_swap_module_params_on_conversion` is ``True``.</span>
@@ -1205,16 +1205,23 @@ <h1>Source code for torch._tensor</h1><div class="highlight"><pre>
1205
1205
1206
1206
<spanclass="sd"> .. note::</span>
1207
1207
<spanclass="sd"> This method should always return a new object that is not ``self`` or ``other``.</span>
1208
-
<spanclass="sd"> For example, the default implementation returns ``self.copy_(other).detach()``.</span>
1208
+
<spanclass="sd"> For example, the default implementation returns ``self.copy_(other).detach()``</span>
1209
+
<spanclass="sd"> if ``assign`` is ``False`` or ``other.detach()`` if ``assign`` is ``True``.</span>
1209
1210
1210
1211
<spanclass="sd"> Args:</span>
1211
1212
<spanclass="sd"> other (Tensor): value in state dict with key corresponding to ``self``</span>
1213
+
<spanclass="sd"> assign (bool): the assign argument passed to :meth:`nn.Module.load_state_dict`</span>
0 commit comments