error message of tf.eye is inconsistent with doc
Hi @cheyennee ,

Thanks for reporting. I need to cross check the implementation and let you update and do necessary. Thanks! Hi @cheyennee ,

**For the code snippet 1:**

Since you are passing `num_rows = "1"` as string and it is raising the error as intended and in the description it is printing num_rows=1, and here 1 is string not a number. By default if you won't provide any value to `num_columns` then `num_columns=num_rows` as per API, hence you are getting same value for both `num_rows` and `num_columns`.

For example if I pass `num_rows = "anything"` then the error description will be like below:


> 

> TypeError: Arguments `num_rows` and `num_columns` must be positive integer values. Received: num_rows=anything, num_columns=anything



I hope this will clarify your query and there is no need to change any description here.



**For the code snippet 2:**

If you pass `num_rows = True`, here True will be converted as 1 and hence `num_rows=1` and `num_columns=1` and the output will be (1,1) shaped tensor.

Hope this clarify your queries. Thanks! @SuryanarayanaY  I see many other APIs that don't convert type internally. So I am a little confused, which APIs will automatically convert type internally, and which ones will not? Hi @cheyennee ,

I hope for `code snippet-1`, I have answered your query right?

I am assuming your question is for `code snippet-2` where True is converted as '1'.Correct me if I am wrong. 

The `tf.eye` API calls `tf.ones` internally and this is where booleans are converted into integer.Please refer the source code and the [gist](https://colab.research.google.com/gist/SuryanarayanaY/c434827ac7569eceb8b37a7f9ab28d50/60457.ipynb) to explain this.

 I think in the both APIs we need to change the description of argument `shape` that it also accepts boolean and converts them into integers 1 or 0.

I think this documentation change will suffice the purpose of this issue right? Please confirm @SuryanarayanaY  Yeah, you're right. I think the documentation should be changed since the argument `shape` can accepts both boolean and integer. You didn't pass a boolean tensor, you passed a Python boolean, which automatically gets converted to and integer when you do math on it.  The function fails if you do actually try to pass a tensor of type `tf.bool`.  It's not useful to document that `tf.ones(True)` happens to work - it has no valid semantic meaning. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60457">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60457">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

tf 2.12.0

### Custom Code

Yes

### OS Platform and Distribution

win11

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

According to [doc](https://tensorflow.google.cn/api_docs/python/tf/eye), the param `num_rows` should be `Non-negative int32 scalar Tensor`. But below snippet code 1 indicates that the param `num_rows` cannot be zero which is inconsistent with doc. On the other hand, the param `num_rows` shouldnt be Bool Tensor, but when given bool tensor, `tf.eye` works, as below snippet code 2 shows.

### Standalone code to reproduce the issue

```shell
snippet code 1:

import tensorflow as tf
results={}
try:
  num_rows = "1"
  results["res"] = tf.eye(num_rows=num_rows)
except Exception as e:
  results["err"] = "Error:"+str(e)
print(results)
# results = Error:Arguments `num_rows` and `num_columns` must be positive integer values. Received: num_rows=1, num_columns=1
```

snippet code 2:
```
import tensorflow as tf
results={}
try:
  num_rows = True
  results["res"] = tf.eye(num_rows=num_rows,)
except Exception as e:
  results["err"] = "Error:"+str(e)
print(results)
# results = {'res': <tf.Tensor: shape=(1, 1), dtype=float32, numpy=array([[1.]], dtype=float32)>}
```
```


### Relevant log output

_No response_</details>