Skip to content

Commit 391ade2

Browse files
committed
cod style refactor changes - part2
1 parent 16a3b93 commit 391ade2

File tree

17 files changed

+628
-102
lines changed

17 files changed

+628
-102
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ You can also use the [older version](https://github.com/serizba/cppflow/tree/243
7777
## Style guide
7878

7979
We use the [Google's C++ style guide](https://google.github.io/styleguide/cppguide.html) using static code linker [cpplint](https://github.com/cpplint/cpplint).
80+
We use the [Google's Python style guide](https://google.github.io/styleguide/pyguide.html) using static code linker [pylint](https://pylint.pycqa.org/en/latest/user_guide/installation/index.html) using attached pylintrc configuration.
81+
8082

8183
## Remark
8284

examples/eager_op_multithread/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
/*!
2525
* @file main.cpp
26-
* @brief A brief description here.
27-
* @details Define custom details for the file here.
2826
* @author Jiannan Liu
2927
* @author Sergio Izquierdo
3028
* @date @showdate "%B %d, %Y" 2020-10-26

examples/efficientnet/create_model.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python
2+
"""
3+
Example for create model functionality.
4+
"""
25

36
# MIT License
47
#
@@ -22,14 +25,10 @@
2225
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2326
# SOFTWARE.
2427

25-
# @file create_model.py
26-
#
27-
# @brief A brief description here.
28-
#
29-
# @section description_create_model Define custom details for the file here.
30-
#
31-
# @section author_create_model Author(s)
32-
# - Created by Sergio Izquierdo
28+
##
29+
# @file create_model.py
30+
# @author Sergio Izquierdo
31+
# @date @showdate "%B %d, %Y" 2020-09-16
3332

3433
# Imports
3534
import tensorflow as tf

examples/efficientnet/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
/*!
2525
* @file main.cpp
26-
* @brief A brief description here.
27-
* @details Define custom details for the file here.
2826
* @author Florian
2927
* @author Sergio Izquierdo
3028
* @date @showdate "%B %d, %Y" 2020-09-16

examples/load_frozen_graph/create_model.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python
2+
"""
3+
Example for a load frozen tf graph functionality.
4+
"""
25

36
# MIT License
47
#
@@ -24,27 +27,23 @@
2427
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2528
# SOFTWARE.
2629

27-
# @file create_model.py
28-
#
29-
# @brief A brief description here.
30-
#
31-
# @section description_create_model Define custom details for the file here.
32-
#
33-
# @section author_create_model Author(s)
34-
# - Created by Daisuke Kato
35-
# - Created by Paul
36-
# - Modified by Sergio Izquierdo
30+
##
31+
# @file create_model.py
32+
# @author Daisuke Kato
33+
# @author Paul
34+
# @author Sergio Izquierdo
35+
# @date @showdate "%B %d, %Y" 2021-09-16
3736

3837
# Imports
3938
import tensorflow as tf
4039
from tensorflow.python.framework.convert_to_constants import (
4140
convert_variables_to_constants_v2,
4241
)
4342

44-
input = tf.keras.Input(shape=(5,))
45-
output = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input)
46-
output = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid)(output)
47-
model = tf.keras.Model(inputs=input, outputs=output)
43+
input_1 = tf.keras.Input(shape=(5,))
44+
output_1 = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input_1)
45+
output_1 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid)(output_1)
46+
model = tf.keras.Model(inputs=input_1, outputs=output_1)
4847

4948
# Create frozen graph
5049
x = tf.TensorSpec(model.input_shape, tf.float32, name="x")

examples/load_frozen_graph/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
/*!
2626
* @file main.cpp
27-
* @brief A brief description here.
28-
* @details Define custom details for the file here.
2927
* @author Daisuke Kato
3028
* @author Paul
3129
* @author Sergio Izquierdo

examples/load_model/create_model.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python
2+
"""
3+
Example for a load model functionality.
4+
"""
25

36
# MIT License
47
#
@@ -22,24 +25,19 @@
2225
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2326
# SOFTWARE.
2427

25-
# @file create_model.py
26-
#
27-
# @brief A brief description here.
28-
#
29-
# @section description_create_model Define custom details for the file here.
30-
#
31-
# @section author_create_model Author(s)
32-
# - Created by Sergio Izquierdo
28+
##
29+
# @file create_model.py
30+
# @author Sergio Izquierdo
31+
# @date @showdate "%B %d, %Y" 2019-05-16
3332

3433
# Imports
3534
import tensorflow as tf
36-
import numpy as np
3735

38-
input = tf.keras.Input(shape=(5,))
36+
input_1 = tf.keras.Input(shape=(5,))
3937

40-
output = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input)
41-
output = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid)(output)
42-
model = tf.keras.Model(inputs=input, outputs=output)
38+
output_1 = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input_1)
39+
output_1 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid)(output_1)
40+
model = tf.keras.Model(inputs=input_1, outputs=output_1)
4341

4442
model.compile()
4543

examples/load_model/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525

2626
/*!
2727
* @file main.cpp
28-
* @brief A brief description here.
29-
* @details Define custom details for the file here.
3028
* @author Afaq Sabir
3129
* @author Florian
3230
* @author Paul Nykiel

examples/multi_input_output/create_model.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python
2+
"""
3+
Example for a multiple inputs and outputs functionality.
4+
"""
25

36
# MIT License
47
#
@@ -22,27 +25,24 @@
2225
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2326
# SOFTWARE.
2427

25-
# @file create_model.py
26-
#
27-
# @brief A brief description here.
28-
#
29-
# @section description_create_model Define custom details for the file here.
30-
#
31-
# @section author_create_model Author(s)
32-
# - Created by Sergio Izquierdo
28+
##
29+
# @file create_model.py
30+
# @author Sergio Izquierdo
31+
# @date @showdate "%B %d, %Y" 2020-10-20
3332

3433
# Imports
3534
import tensorflow as tf
36-
import numpy as np
3735

3836
input_1 = tf.keras.Input(shape=(5,), name='my_input_1')
3937
input_2 = tf.keras.Input(shape=(5,), name='my_input_2')
4038

4139
x1 = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input_1)
4240
x2 = tf.keras.layers.Dense(5, activation=tf.nn.relu)(input_2)
4341

44-
output_1 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid, name='my_outputs_1')(x1)
45-
output_2 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid, name='my_outputs_2')(x2)
42+
output_1 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid,
43+
name='my_outputs_1')(x1)
44+
output_2 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid,
45+
name='my_outputs_2')(x2)
4646

4747
model = tf.keras.Model(inputs=[input_1, input_2], outputs=[output_1, output_2])
4848

examples/multi_input_output/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
/*!
2525
* @file main.cpp
26-
* @brief A brief description here.
27-
* @details Define custom details for the file here.
2826
* @author Florian
2927
* @author Sergio Izquierdo
3028
* @date @showdate "%B %d, %Y" 2020-10-15

examples/tensor/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
/*!
2626
* @file main.cpp
27-
* @brief A brief description here.
28-
* @details Define custom details for the file here.
2927
* @author Jiannan Liu
3028
* @author Seungtaek Kim
3129
* @author Sergio Izquierdo

examples/tensor/odr.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
/*!
2525
* @file odr.cpp
26-
* @brief A brief description here.
27-
* @details Define custom details for the file here.
2826
* @author Jiannan Liu
2927
* @author Sergio Izquierdo
3028
* @date @showdate "%B %d, %Y" 2020-10-26

include/cppflow/model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// SOFTWARE.
2727

2828
/*!
29-
* @file cppflow.h
29+
* @file model.h
3030
* @author Jiannan Liu
3131
* @author liufeng27
3232
* @author Paul

include/cppflow/ops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// SOFTWARE.
2323

2424
/*!
25-
* @file context.h
25+
* @file ops.h
2626
* @author Jiannan Liu
2727
* @author Sergio Izquierdo
2828
* @date @showdate "%B %d, %Y" 2020-07-31

0 commit comments

Comments
 (0)