tf.Tensor([3,2])
执行此操作时,我遇到了
TypeError: __init__() missing 2 required positional arguments: 'value_index' and 'dtype'
答案 0 :(得分:0)
您正在尝试创建一个新的Tensor对象,但没有提供创建所需的两个参数。
您还需要value_index参数,该参数是产生张量的操作端点的索引,而dtype是张量的数据类型(float32,int64等)
有关示例和任何其他问题,请参考以下方便的指向tf.Tensor文档的链接:https://www.tensorflow.org/api_docs/python/tf/Tensor