mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-mxnet] access2rohit commented on a change in pull request #16088: remove 'foo' and other print msg from test
Date Wed, 04 Sep 2019 05:58:01 GMT
access2rohit commented on a change in pull request #16088: remove 'foo' and other print msg
from test
URL: https://github.com/apache/incubator-mxnet/pull/16088#discussion_r320583529
 
 

 ##########
 File path: tests/python/unittest/test_profiler.py
 ##########
 @@ -71,52 +69,51 @@ def test_profiler():
         executor.forward()
         c = executor.outputs[0]
         c.wait_to_read()
-    print("execution end")
+
     duration = t1 - t0
-    print('duration: {0}s'.format(duration))
-    print('          {0}ms/operator'.format(duration*1000/iter_num))
     profiler.dump(True)
     profiler.set_state('stop')
 
 
 def test_profile_create_domain():
     enable_profiler('test_profile_create_domain.json')
     domain = profiler.Domain(name='PythonDomain')
-    print("Domain created: {}".format(str(domain)))
     profiler.set_state('stop')
 
 
 def test_profile_create_domain_dept():
     profiler.set_config(profile_symbolic=True, filename='test_profile_create_domain_dept.json')
     profiler.set_state('run')
     domain = profiler.Domain(name='PythonDomain')
-    print("Domain created: {}".format(str(domain)))
-    profiler.dump_profile()
+    profiler.dump()
     profiler.set_state('stop')
 
+
 def test_profile_task():
     def makeParams():
         objects = tuple('foo' for _ in range(50))
         template = ''.join('{%d}' % i for i in range(len(objects)))
         return template, objects
 
-    def doLog():
+    def get_log():
         template, objects = makeParams()
-        for _ in range(100000):
-            logging.info(template.format(*objects))
+        logs = []
+        for _ in range(10):
+            logs.append(template.format(*objects))
+        return logs
 
-    logging.basicConfig()
     enable_profiler('test_profile_task.json')
     python_domain = profiler.Domain('PythonDomain::test_profile_task')
     task = profiler.Task(python_domain, "test_profile_task")
     task.start()
     start = time.time()
     var = mx.nd.ones((1000, 500))
-    doLog()
+    log = get_log()
+    assert len(log) == 10
 
 Review comment:
   `assert len(get_log()) == 100000`

----------------------------------------------------------------
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

Mime
View raw message