MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / GetSbpFromState

Function GetSbpFromState

oneflow/api/python/symbol/sbp_symbol.cpp:74–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74Maybe<Symbol<SbpParallel>> GetSbpFromState(const std::pair<std::string, int>& state) {
75 if (state.first == "B") {
76 return GetBroadcastSbpParallel();
77 } else if (state.first == "P") {
78 return GetPartialSumSbpParallel();
79 } else if (state.first == "S") {
80 return GetSplitSbpParallel(state.second);
81 } else {
82 return Error::RuntimeError() << "Invalid sbp signature state: (" << state.first << ", "
83 << state.second << ");";
84 }
85}
86
87} // namespace
88

Callers 1

sbp_symbol.cppFile · 0.85

Calls 3

GetBroadcastSbpParallelFunction · 0.85
GetPartialSumSbpParallelFunction · 0.85
GetSplitSbpParallelFunction · 0.85

Tested by

no test coverage detected