Explorar o código

add space between # and character

Yunfeng Wang %!s(int64=8) %!d(string=hai) anos
pai
achega
bc8c77db15

+ 1 - 1
examples/1_Introduction/helloworld.py

@@ -9,7 +9,7 @@ from __future__ import print_function
 
 import tensorflow as tf
 
-#Simple hello world using TensorFlow
+# Simple hello world using TensorFlow
 
 # Create a Constant op
 # The op is added as a node to the default graph.

+ 2 - 2
examples/2_BasicModels/linear_regression.py

@@ -52,7 +52,7 @@ with tf.Session() as sess:
         for (x, y) in zip(train_X, train_Y):
             sess.run(optimizer, feed_dict={X: x, Y: y})
 
-        #Display logs per epoch step
+        # Display logs per epoch step
         if (epoch+1) % display_step == 0:
             c = sess.run(cost, feed_dict={X: train_X, Y:train_Y})
             print("Epoch:", '%04d' % (epoch+1), "cost=", "{:.9f}".format(c), \
@@ -62,7 +62,7 @@ with tf.Session() as sess:
     training_cost = sess.run(cost, feed_dict={X: train_X, Y: train_Y})
     print("Training cost=", training_cost, "W=", sess.run(W), "b=", sess.run(b), '\n')
 
-    #Graphic display
+    # Graphic display
     plt.plot(train_X, train_Y, 'ro', label='Original data')
     plt.plot(train_X, sess.run(W) * train_X + sess.run(b), label='Fitted line')
     plt.legend()

+ 11 - 11
examples/5_MultiGPU/multigpu_basics.py

@@ -18,10 +18,10 @@ import numpy as np
 import tensorflow as tf
 import datetime
 
-#Processing Units logs
+# Processing Units logs
 log_device_placement = True
 
-#num of multiplications to perform
+# Num of multiplications to perform
 n = 10
 
 '''
@@ -30,11 +30,11 @@ Results on 8 cores with 2 GTX-980:
  * Single GPU computation time: 0:00:11.277449
  * Multi GPU computation time: 0:00:07.131701
 '''
-#Create random large matrix
+# Create random large matrix
 A = np.random.rand(1e4, 1e4).astype('float32')
 B = np.random.rand(1e4, 1e4).astype('float32')
 
-# Creates a graph to store results
+# Create a graph to store results
 c1 = []
 c2 = []
 
@@ -50,7 +50,7 @@ Single GPU computing
 with tf.device('/gpu:0'):
     a = tf.constant(A)
     b = tf.constant(B)
-    #compute A^n and B^n and store results in c1
+    # Compute A^n and B^n and store results in c1
     c1.append(matpow(a, n))
     c1.append(matpow(b, n))
 
@@ -59,7 +59,7 @@ with tf.device('/cpu:0'):
 
 t1_1 = datetime.datetime.now()
 with tf.Session(config=tf.ConfigProto(log_device_placement=log_device_placement)) as sess:
-    # Runs the op.
+    # Run the op.
     sess.run(sum)
 t2_1 = datetime.datetime.now()
 
@@ -67,15 +67,15 @@ t2_1 = datetime.datetime.now()
 '''
 Multi GPU computing
 '''
-#GPU:0 computes A^n
+# GPU:0 computes A^n
 with tf.device('/gpu:0'):
-    #compute A^n and store result in c2
+    # Compute A^n and store result in c2
     a = tf.constant(A)
     c2.append(matpow(a, n))
 
-#GPU:1 computes B^n
+# GPU:1 computes B^n
 with tf.device('/gpu:1'):
-    #compute B^n and store result in c2
+    # Compute B^n and store result in c2
     b = tf.constant(B)
     c2.append(matpow(b, n))
 
@@ -84,7 +84,7 @@ with tf.device('/cpu:0'):
 
 t1_2 = datetime.datetime.now()
 with tf.Session(config=tf.ConfigProto(log_device_placement=log_device_placement)) as sess:
-    # Runs the op.
+    # Run the op.
     sess.run(sum)
 t2_2 = datetime.datetime.now()