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

Function skip_unless

python/oneflow/framework/unittest.py:188–198  ·  view source on GitHub ↗
(n, d)

Source from the content-addressed store, hash-verified

186
187
188def skip_unless(n, d):
189 if (n > 1 or d > 1) and oneflow.sysconfig.has_rpc_backend_grpc() == False:
190 return unittest.skip(
191 "requires multi node rpc backend when node_size > 1 and device_num > 1"
192 )
193 if node_size() == n and device_num() == d:
194 return lambda func: func
195 else:
196 return unittest.skip(
197 "only runs when node_size is {} and device_num is {}".format(n, d)
198 )
199
200
201def skip_unless_1n1d():

Callers 6

skip_unless_1n1dFunction · 0.85
skip_unless_1n2dFunction · 0.85
skip_unless_1n4dFunction · 0.85
skip_unless_2n1dFunction · 0.85
skip_unless_2n2dFunction · 0.85
skip_unless_2n4dFunction · 0.85

Calls 3

node_sizeFunction · 0.85
device_numFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected