GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Better comparison if we failed the speed test or not. · zencoding/DeepLearningTutorials@53f7710

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • code
    • test.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎code/test.py‎

Copy file name to clipboardExpand all lines: code/test.py
+12-3Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,20 @@ def do_tests():
185185
print >> sys.stderr, 'float32/gpu',float32_times/gpu_times
186186
print >> sys.stderr, 'expected float32/gpu',expected_times_32/gpu_times
187187

188+
def compare(x, y):
189+
ratio = x / y
190+
# If there is more then 5% difference between the expected
191+
# time and the real time, we consider this an error.
192+
return sum((ratio < 0.95) + (ratio > 1.05))
193+
188194
if do_float64:
189-
print >> sys.stderr, 'speed_failure_float64='+str(sum((expected_times_64/float64_times)>0.95))
195+
err = compare(expected_times_64, float64_times)
196+
print >> sys.stderr, 'speed_failure_float64=' + str(err)
190197
if do_float32:
191-
print >> sys.stderr, 'speed_failure_float32='+str(sum((expected_times_32/float32_times)>0.95))
198+
err = compare(expected_times_32, float32_times)
199+
print >> sys.stderr, 'speed_failure_float32=' + str(err)
192200
if do_gpu:
193-
print >> sys.stderr, 'speed_failure_gpu='+str(sum((expected_times_gpu/gpu_times)>0.95))
201+
err = compare(expected_times_gpu, gpu_times)
202+
print >> sys.stderr, 'speed_failure_gpu=' + str(err)
194203

195204
assert not numpy.isnan(gpu_times).any()

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.