Skip to content

Commit 02b387d

Browse files
committed
spacing issue
1 parent bdf9225 commit 02b387d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

gpu-tutorial.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,34 @@
33
print('running on default hardware...')
44

55
# creates a graph.
6+
67
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
78
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
89
c = tf.matmul(a, b)
10+
911
# Creates a session with log_device_placement set to True.
12+
1013
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
14+
1115
# Runs the op.
16+
1217
print(sess.run(c))
1318

1419
print('running on gpu hardware...')
1520

1621
# Creates a graph.
22+
1723
with tf.device('/gpu:0'):
1824
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
1925
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
2026
c = tf.matmul(a, b)
27+
2128
# Creates a session with log_device_placement set to True.
29+
2230
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
23-
# Runs the op.
31+
32+
# Runs the op
33+
2434
print(sess.run(c))
2535

2636

submit-gpu.s

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
#SBATCH --partition=gpu
33
#SBATCH --gres=gpu:1
44
#SBATCH --get-user-env
5+
56
srun python gpu-tutorial.py

0 commit comments

Comments
 (0)