validate argument axis of tf.experimental.numpy.stack
It _is_ raising an error.  Even in your gist you provide in this description.  So what's the issue? > It _is_ raising an error. Even in your gist you provide in this description. So what's the issue?

Sorry you might have gone through the `tf.stack`. I have deleted that part in gist and updated it.

Its not raising the error for `tensorflow.experimental.numpy.stack`. Please check the below code in gist for and its not raising the error. 

```
import tensorflow.experimental.numpy as tnp
tnp.experimental_enable_numpy_behavior()
x = tf.random.uniform([5])
tnp.stack(x, axis=-2) # Passes without any error
```

Thanks! That's not throwing an error because the axis is valid: it can be in the range [0, 1], and negative values work backwards from the end, so -2 corresponds to axis=0 and -1 corresponds to axis=1 in this case.  Your example fails if you pass axis=-3. Hi @SuryanarayanaY Can you please check @cantonios's comments ? Thank you! For earlier case the explanation holds right. I tested with new code.Please refer below code.

```
import tensorflow.experimental.numpy as tnp
tnp.experimental_enable_numpy_behavior()
x = tf.random.uniform([5,3])
tnp.stack(x, axis=-4) # passes without error
tnp.stack(x, axis=-3) # passes without error
```

Whereas with Numpy it raises error.

```
import numpy as np
x_n = np.random.randn(5, 3)
print(np.shape(x_n))
np.stack(x_n, axis=-4) # raises error
np.stack(x_n, axis=-3) # raises error
```
Please refer the new gist attached [here](https://colab.research.google.com/gist/SuryanarayanaY/294965c552daca8eb24f0189f865908f/60727.ipynb)  and the proposed code change might resolve this.
 Hi @cantonios Can you please review this PR ? Thank you! Hi @SuryanarayanaY  Can you please check @cantonios's comments and keep us posted ? Thank you! Requested for review Hi @cantonios Can you please review this PR ? Thank you! Hi @SuryanarayanaY Any update on this PR? Please. Thank you! Apologies for the delay. Changed  axis validation in swapaxes() as suggested. @gbaned , Could you please review and do needful. Thanks Hi @SuryanarayanaY Can you please check @cantonios's comments ? Thanks you! Hi @SuryanarayanaY Any update on this PR? Please. Thank you! Hi @SuryanarayanaY Any update on this PR? Please. Thank you! Hi @SuryanarayanaY Any update on this PR? Please. Thank you! Hi @SuryanarayanaY Any update on this PR? Please. Thank you! Hi @SuryanarayanaY Any update on this PR? Please. Thank you! This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. Hi @SuryanarayanaY Any update on this PR? Please. Thank you! This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. Hi @SuryanarayanaY Any update on this PR? Please. Thank you! This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. Hi @SuryanarayanaY Any update on this PR? Please. Thank you! Hi @SuryanarayanaY Any update on this PR? Please. Thank you! Hi @SuryanarayanaY Any update on this PR? Please. Thank you! Hi @SuryanarayanaY Any update on this PR? Please. Thank you! Hi @SuryanarayanaY Any update on this PR? Please. Thank you!


AT present `tf.experimental.numpy.stack` not validating the values for `axis` argument. If we pass out of bound values to the `axis` still it is not rising the Error. Hence I am proposing amendments to validate the `axis` argument and raise the Error in case of out of bound axis.

Please find the attached [gist](https://colab.research.google.com/gist/SuryanarayanaY/db882df3c2245044a96cd943dead229e/git_55217_nightly-2-14.ipynb) for explaining the problem and also with proposed amendments to the code it works fine and raised intended error when invalid axis arguments provided.

Fixes #55217
