MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / cb

Function cb

DeepSpeedExample/megatron/core/tensor_parallel/random.py:75–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73 if hasattr(_C, '_cuda_setRNGState') and callable(_C._cuda_setRNGState):
74 # older PyTorch
75 def cb():
76 with get_accelerator().device(device):
77 _C._cuda_setRNGState(new_state)
78 else:
79 # newer PyTorch
80 if device == -1:

Callers

nothing calls this directly

Calls 5

get_acceleratorFunction · 0.90
deviceMethod · 0.45
current_deviceMethod · 0.45
default_generatorMethod · 0.45
set_stateMethod · 0.45

Tested by

no test coverage detected