vendredi 22 septembre 2017

what the trace result of tensorflow

i upload a image to test if i can upload a image to the internet

a image example,test if i can upload a image to the internet

import tensorflow as tf import numpy as np import time

W=3000 H=4000

in_a = tf.placeholder(tf.float32,(W,H)) in_b = tf.placeholder(tf.float32,(W,H))

def test_sub(number): sess=tf.Session() out = tf.subtract(in_a,in_b)

  for i in range(number):          
      a=np.random.rand(W,H)
      b=np.random.rand(W,H)
      feed_dict = {in_a:a,
                   in_b:b}
      t0=time.time()
      out_ = sess.run(out,feed_dict=feed_dict)
      t_=(time.time()-t0) * 1000
      print "index:",str(i), " total time:",str(t_)," ms"  

test_sub(20)

Aucun commentaire:

Enregistrer un commentaire