MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / _get_stream

Function _get_stream

lib/nn/parallel/data_parallel.py:104–112  ·  view source on GitHub ↗

Gets a background stream for copying between CPU and GPU

(device)

Source from the content-addressed store, hash-verified

102
103
104def _get_stream(device):
105 """Gets a background stream for copying between CPU and GPU"""
106 global _streams
107 if device == -1:
108 return None
109 if _streams is None:
110 _streams = [None] * cuda.device_count()
111 if _streams[device] is None: _streams[device] = cuda.Stream(device)
112 return _streams[device]

Callers 1

_async_copy_streamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected