Skip to content

Commit d96826c

Browse files
author
atian
committed
fix bug:AttributeError: module 'tensorflow' has no attribute 'sub'
Signed-off-by: atian <lai@atian.me>
1 parent 9a4bc18 commit d96826c

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

01_Introduction/05_Declaring_Operations/05_operations.ipynb

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@
6161
{
6262
"cell_type": "code",
6363
"execution_count": 3,
64-
"metadata": {
65-
"collapsed": false
66-
},
64+
"metadata": {},
6765
"outputs": [
6866
{
6967
"name": "stdout",
@@ -91,9 +89,7 @@
9189
{
9290
"cell_type": "code",
9391
"execution_count": 4,
94-
"metadata": {
95-
"collapsed": false
96-
},
92+
"metadata": {},
9793
"outputs": [
9894
{
9995
"name": "stdout",
@@ -117,9 +113,7 @@
117113
{
118114
"cell_type": "code",
119115
"execution_count": 5,
120-
"metadata": {
121-
"collapsed": false
122-
},
116+
"metadata": {},
123117
"outputs": [
124118
{
125119
"name": "stdout",
@@ -145,9 +139,7 @@
145139
{
146140
"cell_type": "code",
147141
"execution_count": 6,
148-
"metadata": {
149-
"collapsed": false
150-
},
142+
"metadata": {},
151143
"outputs": [
152144
{
153145
"name": "stdout",
@@ -179,9 +171,7 @@
179171
{
180172
"cell_type": "code",
181173
"execution_count": 7,
182-
"metadata": {
183-
"collapsed": false
184-
},
174+
"metadata": {},
185175
"outputs": [
186176
{
187177
"name": "stdout",
@@ -196,7 +186,7 @@
196186
"\n",
197187
"def custom_polynomial(x_val):\n",
198188
" # Return 3x^2 - x + 10\n",
199-
" return(tf.sub(3 * tf.square(x_val), x_val) + 10)\n",
189+
" return(tf.subtract(3 * tf.square(x_val), x_val) + 10)\n",
200190
"\n",
201191
"print(sess.run(custom_polynomial(11)))"
202192
]
@@ -211,9 +201,7 @@
211201
{
212202
"cell_type": "code",
213203
"execution_count": 8,
214-
"metadata": {
215-
"collapsed": false
216-
},
204+
"metadata": {},
217205
"outputs": [
218206
{
219207
"name": "stdout",
@@ -238,9 +226,7 @@
238226
{
239227
"cell_type": "code",
240228
"execution_count": 9,
241-
"metadata": {
242-
"collapsed": false
243-
},
229+
"metadata": {},
244230
"outputs": [
245231
{
246232
"name": "stdout",
@@ -286,7 +272,7 @@
286272
"name": "python",
287273
"nbconvert_exporter": "python",
288274
"pygments_lexer": "ipython3",
289-
"version": "3.5.2"
275+
"version": "3.5.5"
290276
}
291277
},
292278
"nbformat": 4,

0 commit comments

Comments
 (0)