Skip to content

Commit bc8c77d

Browse files
author
Yunfeng Wang
committed
add space between # and character
1 parent c6d8d68 commit bc8c77d

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

examples/1_Introduction/helloworld.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import tensorflow as tf
1111

12-
#Simple hello world using TensorFlow
12+
# Simple hello world using TensorFlow
1313

1414
# Create a Constant op
1515
# The op is added as a node to the default graph.

examples/2_BasicModels/linear_regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
for (x, y) in zip(train_X, train_Y):
5353
sess.run(optimizer, feed_dict={X: x, Y: y})
5454

55-
#Display logs per epoch step
55+
# Display logs per epoch step
5656
if (epoch+1) % display_step == 0:
5757
c = sess.run(cost, feed_dict={X: train_X, Y:train_Y})
5858
print("Epoch:", '%04d' % (epoch+1), "cost=", "{:.9f}".format(c), \
@@ -62,7 +62,7 @@
6262
training_cost = sess.run(cost, feed_dict={X: train_X, Y: train_Y})
6363
print("Training cost=", training_cost, "W=", sess.run(W), "b=", sess.run(b), '\n')
6464

65-
#Graphic display
65+
# Graphic display
6666
plt.plot(train_X, train_Y, 'ro', label='Original data')
6767
plt.plot(train_X, sess.run(W) * train_X + sess.run(b), label='Fitted line')
6868
plt.legend()

examples/5_MultiGPU/multigpu_basics.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import tensorflow as tf
1919
import datetime
2020

21-
#Processing Units logs
21+
# Processing Units logs
2222
log_device_placement = True
2323

24-
#num of multiplications to perform
24+
# Num of multiplications to perform
2525
n = 10
2626

2727
'''
@@ -30,11 +30,11 @@
3030
* Single GPU computation time: 0:00:11.277449
3131
* Multi GPU computation time: 0:00:07.131701
3232
'''
33-
#Create random large matrix
33+
# Create random large matrix
3434
A = np.random.rand(1e4, 1e4).astype('float32')
3535
B = np.random.rand(1e4, 1e4).astype('float32')
3636

37-
# Creates a graph to store results
37+
# Create a graph to store results
3838
c1 = []
3939
c2 = []
4040

@@ -50,7 +50,7 @@ def matpow(M, n):
5050
with tf.device('/gpu:0'):
5151
a = tf.constant(A)
5252
b = tf.constant(B)
53-
#compute A^n and B^n and store results in c1
53+
# Compute A^n and B^n and store results in c1
5454
c1.append(matpow(a, n))
5555
c1.append(matpow(b, n))
5656

@@ -59,23 +59,23 @@ def matpow(M, n):
5959

6060
t1_1 = datetime.datetime.now()
6161
with tf.Session(config=tf.ConfigProto(log_device_placement=log_device_placement)) as sess:
62-
# Runs the op.
62+
# Run the op.
6363
sess.run(sum)
6464
t2_1 = datetime.datetime.now()
6565

6666

6767
'''
6868
Multi GPU computing
6969
'''
70-
#GPU:0 computes A^n
70+
# GPU:0 computes A^n
7171
with tf.device('/gpu:0'):
72-
#compute A^n and store result in c2
72+
# Compute A^n and store result in c2
7373
a = tf.constant(A)
7474
c2.append(matpow(a, n))
7575

76-
#GPU:1 computes B^n
76+
# GPU:1 computes B^n
7777
with tf.device('/gpu:1'):
78-
#compute B^n and store result in c2
78+
# Compute B^n and store result in c2
7979
b = tf.constant(B)
8080
c2.append(matpow(b, n))
8181

@@ -84,7 +84,7 @@ def matpow(M, n):
8484

8585
t1_2 = datetime.datetime.now()
8686
with tf.Session(config=tf.ConfigProto(log_device_placement=log_device_placement)) as sess:
87-
# Runs the op.
87+
# Run the op.
8888
sess.run(sum)
8989
t2_2 = datetime.datetime.now()
9090

0 commit comments

Comments
 (0)