MCPcopy Create free account
hub / github.com/pytorch/pytorch / run

Method run

caffe2/experiments/python/device_reduce_sum_bench.py:62–73  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

60
61class SumElements(Benchmark):
62 def run(self):
63 op = core.CreateOperator(
64 "SumElements",
65 ["X"],
66 ["y"]
67 )
68
69 for n in itertools.imap(pow, itertools.cycle([10]), range(10)):
70 X = np.random.rand(n).astype(np.float32)
71 logger.info('Running benchmark for n = {}'.format(n))
72 ret = runOpBenchmark(gpu_do, op, inputs=[X])
73 self.results.append((n, ret[1]))
74
75
76class SumSqrElements(Benchmark):

Callers 2

mainFunction · 0.45

Calls 7

runOpBenchmarkFunction · 0.90
astypeMethod · 0.80
infoMethod · 0.80
rangeFunction · 0.50
randMethod · 0.45
formatMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected