Skip to content

Commit 081a2b8

Browse files
committed
yapf
1 parent 9f0136d commit 081a2b8

10 files changed

+15
-15
lines changed

examples/basic_tutorials/tutorial_SequentialLayer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
33

44
from tensorlayer.layers import SequentialLayer

examples/basic_tutorials/tutorial_automatic_inference_input _shape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
33

44
import numpy as np

examples/basic_tutorials/tutorial_cifar10_cnn_mindspore_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
33

44
import os

examples/basic_tutorials/tutorial_cifar10_cnn_tensorflow_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
33
# The tensorlayer and tensorflow operators can be mixed
44

examples/basic_tutorials/tutorial_dataflow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
3+
34
import os
45
os.environ['TL_BACKEND'] = 'tensorflow'
56
# os.environ['TL_BACKEND'] = 'mindspore'

examples/basic_tutorials/tutorial_mnist_mlp_mindspore_backend.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
#!/usr/bin/env python3
1+
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
3-
import mindspore.nn as nn
3+
44
import mindspore.ops.operations as P
55
from mindspore.ops import composite as C
6-
from mindspore.common import dtype as mstype
7-
from mindspore import context, Tensor, ParameterTuple
8-
from mindspore.common.initializer import TruncatedNormal
9-
from mindspore.nn import SoftmaxCrossEntropyWithLogits, Momentum, WithLossCell
6+
from mindspore import ParameterTuple
7+
from mindspore.nn import Momentum, WithLossCell
108

119
import numpy as np
1210
import tensorlayer as tl

examples/basic_tutorials/tutorial_mnist_mlp_paddlepaddle_backend.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
33
# The tensorlayer and Paddle operators can be mixed
4+
45
import os
56
os.environ['TL_BACKEND'] = 'paddle'
67

examples/basic_tutorials/tutorial_mnist_mlp_tensorflow_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
33
# The tensorlayer and tensorflow operators can be mixed
44

examples/basic_tutorials/tutorial_mnist_simple.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#!/usr/bin/env python3
1+
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
33

44
# The same set of code can switch the backend with one line
55
import os
66
os.environ['TL_BACKEND'] = 'tensorflow'
77
# os.environ['TL_BACKEND'] = 'mindspore'
88
# os.environ['TL_BACKEND'] = 'paddle'
9-
import numpy as np
9+
1010
import tensorlayer as tl
1111
from tensorlayer.layers import Module
1212
from tensorlayer.layers import Dense, Dropout, Flatten
@@ -68,7 +68,7 @@ def forward(self, x, foo=None):
6868

6969

7070
train_weights = MLP.trainable_weights
71-
optimizer = tl.optimizers.Momentum(0.001, 0.9)
71+
optimizer = tl.optimizers.Momentum(0.05, 0.9)
7272
metric = tl.metric.Accuracy()
7373
train_dataset = mnistdataset(data = X_train, label = y_train ,transform = transform)
7474
train_dataset = tl.dataflow.FromGenerator(train_dataset, output_types=[tl.float32, tl.int64], column_names=['data', 'label'])

examples/basic_tutorials/tutorial_nested_usage_of_Layer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#! /usr/bin/python
22
# -*- coding: utf-8 -*-
33

44
import time

0 commit comments

Comments
 (0)