Skip to content

Commit f2399a3

Browse files
zsdonghaolgarithm
authored andcommitted
samplified-example-code (#385)
* Update tutorial_mlp_dropout2.py * Update tutorial_mlp_dropout1.py * Update tutorial_mnist_simple.py * Update tutorial_mnist_float16.py * fix format * fix format
1 parent ac9304b commit f2399a3

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

example/tutorial_mlp_dropout1.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
tl.files.load_mnist_dataset(shape=(-1,784))
1313
# define placeholder
1414
x = tf.placeholder(tf.float32, shape=[None, 784], name='x')
15-
y_ = tf.placeholder(
16-
tf.int64, shape=[
17-
None,
18-
], name='y_')
15+
y_ = tf.placeholder(tf.int64, shape=[None], name='y_')
1916

2017
# define the network
2118
network = tl.layers.InputLayer(x, name='input')

example/tutorial_mlp_dropout2.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
tl.files.load_mnist_dataset(shape=(-1,784))
1313
# define placeholder
1414
x = tf.placeholder(tf.float32, shape=[None, 784], name='x')
15-
y_ = tf.placeholder(
16-
tf.int64, shape=[
17-
None,
18-
], name='y_')
15+
y_ = tf.placeholder(tf.int64, shape=[None], name='y_')
1916

2017

2118
# define the network

example/tutorial_mnist_float16.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515
batch_size = 128
1616

1717
x = tf.placeholder(LayersConfig.tf_dtype, shape=[batch_size, 28, 28, 1])
18-
y_ = tf.placeholder(
19-
tf.int64, shape=[
20-
batch_size,
21-
])
18+
y_ = tf.placeholder(tf.int64, shape=[batch_size])
2219

2320

2421
def model(x, is_train=True, reuse=False):

example/tutorial_mnist_simple.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
tl.files.load_mnist_dataset(shape=(-1,784))
1313
# define placeholder
1414
x = tf.placeholder(tf.float32, shape=[None, 784], name='x')
15-
y_ = tf.placeholder(
16-
tf.int64, shape=[
17-
None,
18-
], name='y_')
15+
y_ = tf.placeholder(tf.int64, shape=[None], name='y_')
1916

2017
# define the network
2118
network = tl.layers.InputLayer(x, name='input')

0 commit comments

Comments
 (0)