Skip to content

Commit edb2875

Browse files
authored
fix missing __name__ attribute in partial function (#1466)
Summary: This fixes the CI error introduced in the diff below this diff. Landing the fix here, will also see how this kicks off a PR in OSS repo. The error was not caught in the CI of OSS because we might not have GPU code unit testing - need to fix that! Differential Revision: D71564699
1 parent b54da34 commit edb2875

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

torchdata/nodes/pin_memory.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,16 @@ def reset(self, initial_state: Optional[Dict[str, Any]] = None):
135135
if self._it is not None:
136136
self._it._shutdown()
137137
del self._it
138+
138139
self._it = _SingleThreadedMapper(
139140
source=self.source,
140141
prefetch_factor=1,
141-
worker=functools.partial(
142-
_pin_memory_loop,
143-
device_id=self._current_device,
144-
device=self._pin_memory_device,
142+
worker=functools.wraps(_pin_memory_loop)(
143+
functools.partial(
144+
_pin_memory_loop,
145+
device_id=self._current_device,
146+
device=self._pin_memory_device,
147+
)
145148
),
146149
snapshot_frequency=self.snapshot_frequency,
147150
initial_state=initial_state,

0 commit comments

Comments
 (0)