TypeError: __init__() missing 2 required positional arguments: 'value_index' and 'dtype'

Viewed 2318
tf.Tensor([3,2])

when I do this I got the error with

TypeError: __init__() missing 2 required positional arguments: 'value_index' and 'dtype'
1 Answers

You are trying to create a new Tensor object but you are not providing two of the required arguments for creation.

You also need the value_index argument, which is the index of the operation's endpoint that produces your tensor and dtype, which is the data type of your tensor (float32, int64, etc.)

Refer to this handy link to the documentation of tf.Tensor for examples and any further questions: https://www.tensorflow.org/api_docs/python/tf/Tensor

Related