MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / pin_empty

Method pin_empty

deepspeed/utils/pin_memory.py:48–51  ·  view source on GitHub ↗
(self, example, shape)

Source from the content-addressed store, hash-verified

46 return locked
47
48 def pin_empty(self, example, shape):
49 # ``example`` is dtype-only. ``pin()`` sizes the allocation from
50 # ``example.numel()``, so a 0-element template cannot be passed through.
51 return self._new_locked(example, shape)
52
53 def _new_locked(self, example, out_shape):
54 numel = 1

Calls 1

_new_lockedMethod · 0.95