具有5个系数的Halley多项式和具有Eager的初始x值

时间:2018-10-26 15:09:01

标签: python tensorflow syntax-error

我正在使用急切模式。致电Halley,但收到错误消息。此外,还有“条件”和“身体”功能(未显示)。

import tensorflow as tf
import numpy as n
print(tf.__version__)
tf.enable_eager_execution()

def Halley(coeff, x0):
    loop_vars=x0[0],coeff
    # Add an Op to initialize global variables.
    init_op = tf.global_variables_initializer()
    result = tf.while_loop(condition, body, loop_vars)
    return  result

 roots = Halley(tf.constant([
  [1,-5,6,-4,1],
  [1]
 ]))

File "<ipython-input-5-dab6d9ec95bd>", line 40
roots = Halley(tf.constant([
    ^
SyntaxError: invalid syntax

0 个答案:

没有答案