MCPcopy Create free account
hub / github.com/XL2248/MSCTD / parallel_model

Function parallel_model

src_code/thumt1_code/thumt/utils/parallel.py:92–99  ·  view source on GitHub ↗
(model_fn, features, devices)

Source from the content-addressed store, hash-verified

90
91
92def parallel_model(model_fn, features, devices):
93 if len(devices) == 1:
94 return [model_fn(features)]
95
96 features = shard_features(features, devices)
97
98 outputs = data_parallelism(devices, model_fn, features)
99 return outputs

Callers

nothing calls this directly

Calls 2

shard_featuresFunction · 0.70
data_parallelismFunction · 0.70

Tested by

no test coverage detected