MCPcopy Create free account
hub / github.com/NVIDIA/DALI / common_case

Function common_case

dali/test/python/test_dltensor_operator.py:139–153  ·  view source on GitHub ↗
(wrapped_fun, device, compare, synchronize=True)

Source from the content-addressed store, hash-verified

137
138
139def common_case(wrapped_fun, device, compare, synchronize=True):
140 load_pipe = LoadingPipeline(device)
141 op_pipe = DLTensorOpPipeline(wrapped_fun, device, synchronize)
142
143 for iter in range(ITERS):
144 pre1, pre2 = load_pipe.run()
145 post1, post2 = op_pipe.run()
146
147 if device == "gpu":
148 pre1 = pre1.as_cpu()
149 pre2 = pre2.as_cpu()
150 post1 = post1.as_cpu()
151 post2 = post2.as_cpu()
152
153 compare(pre1, pre2, post1, post2)
154
155
156def pytorch_compare(fun, pre1, pre2, post1, post2):

Callers 2

pytorch_caseFunction · 0.85
cupy_caseFunction · 0.85

Calls 4

LoadingPipelineClass · 0.85
DLTensorOpPipelineClass · 0.85
compareFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected