You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/06/20 18:14:41 UTC

[GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #15240: Fixing duplication in operator profiling

access2rohit commented on a change in pull request #15240: Fixing duplication in operator profiling
URL: https://github.com/apache/incubator-mxnet/pull/15240#discussion_r295933321
 
 

 ##########
 File path: tests/python/unittest/test_profiler.py
 ##########
 @@ -269,6 +269,28 @@ def check_sorting(debug_str, sort_by, ascending):
             check_sorting(debug_str, sb, asc)
     profiler.set_state('stop')
 
+def test_aggregate_duplication():
+    file_name = 'test_aggregate_duplication.json'
+    enable_profiler(profile_filename = file_name, run=True, continuous_dump=True, \
+                    aggregate_stats=True)
+    inp = mx.nd.zeros(shape=(100, 100))
+    y = mx.nd.sqrt(inp)
+    inp = inp + 1
+    inp = inp + 1
+    mx.nd.waitall()
+    profiler.dump(False)
+    debug_str = profiler.dumps(format = 'json')
+    target_dict = json.loads(debug_str)
+    assert 'Time' in target_dict and 'operator' in target_dict['Time'] \
+        and 'sqrt' in target_dict['Time']['operator'] \
+        and 'Count' in target_dict['Time']['operator']['sqrt'] \
+        and '_plus_scalar' in target_dict['Time']['operator'] \
+        and 'Count' in target_dict['Time']['operator']['_plus_scalar']
+    # thet are called once and twice respectively
 
 Review comment:
   typo: they ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services