Attributes of tensorflow operations

Consider the following example: a=tf.constant([[1,2,3],[4,5,6]],shape=(2,3),name=”a”) b=a+1 It will produce the following graph: We can see a constant tensorflow operation has two attributes: dtype is the type of the elements stored […]

How is tensorflow while_loop implemented?

Consider the following example: i = tf.get_variable(“i”, dtype=tf.int32, shape=[], initializer=tf.ones_initializer()) n = tf.constant(10) def cond(a, n): return a< n def body(a, n): a = a + 2 return a, n […]

In Linux, you can compute the md5 of a file using the md5 command. md5 file You can compare the output of the md5 with the md5 published on the […]

The python with statement is a little strange to programmers of other languages. It is frequently occurred in tensorflow related codes like: with tf.Session() as sess: do something A new […]