类型错误:__init__() 缺少 2 个必需的位置参数:“value_index”和“dtype”

use*_*246 7 tensorflow tensorflow2.0

tf.Tensor([3,2])
Run Code Online (Sandbox Code Playgroud)

当我这样做时,我收到错误

TypeError: __init__() missing 2 required positional arguments: 'value_index' and 'dtype'
Run Code Online (Sandbox Code Playgroud)

mon*_*mon 0

tf.constant([3,2])代替tf.Tensor([3,2])