Skip to content

Instantly share code, notes, and snippets.

@connorgoggins
Last active February 17, 2020 23:25
Show Gist options
  • Save connorgoggins/d97d64e73702a342bdeb170d30aef04f to your computer and use it in GitHub Desktop.
Save connorgoggins/d97d64e73702a342bdeb170d30aef04f to your computer and use it in GitHub Desktop.

Script:

from mxnet import nd
from benchmark.opperf.utils.benchmark_utils import run_performance_test

print(run_performance_test(nd.SpatialTransformer, run_backward=True, inputs=[{'data': (2, 2**29,1,6), 'loc': nd.random_normal(shape=(2,6)), 'transform_type': 'affine', 'sampler_type': 'bilinear', 'target_shape': (2,6)}], warmup=1, runs=1))

Output:

INFO:root:Begin Benchmark - SpatialTransformer
INFO:root:Complete Benchmark - SpatialTransformer
[{'SpatialTransformer': [{'inputs': {'data': (2, 536870912, 1, 6), 'loc': '<NDArray 2x6 @cpu(0)>', 'transform_type': 'affine', 'sampler_type': 'bilinear', 't
arget_shape': (2, 6)}, 'max_storage_mem_alloc_cpu/0': 102005472.0, 'avg_time_forward_SpatialTransformer': 551614.125, 'avg_time_backward_SpatialTransformer':
 511034.0938}]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment