How to check for NoneTensorSpec?
**NoneTensorSpec** is not a public API in TensorFlow, so it is not directly accessible from the public API. However, you can access it through the private module **_tensor_spec**, like this:

```
from tensorflow.python.framework import tensor_spec as _tensor_spec
import tensorflow as tf

spec = tf.TensorSpec(shape=(2, 3), dtype=tf.float32)
spec_with_none = tf.TensorSpec(shape=(2, 3), dtype=tf.float32, name='maybe_none')
specs = [spec, spec_with_none]

# Find specs with NoneTensorSpec
none_specs = [s for s in specs if isinstance(s, _tensor_spec.NoneTensorSpec)]

# Replace NoneTensorSpec with None
for i, s in enumerate(specs):
    if isinstance(s, _tensor_spec.NoneTensorSpec):
        specs[i] = None
``` @pat749, Thanks for your time and effort on responding to the issue.
@hamzamerzic , Can you take a look into the above response, also have you checked `tf.TensorSpec `https://www.tensorflow.org/api_docs/python/tf/TensorSpec?version=nightly if that is something which you are looking for. Thanks! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. Thanks. I just tried this in a public Colab running TF 2.12.0 and I get an `AttributeError: module 'tensorflow.python.framework.tensor_spec' has no attribute 'NoneTensorSpec'`. I looked at the nightly `tf.TensorSpec` API as well, but there is no mention of `NoneTensorSpec`.

But it does look like the following works:

```python
from tensorflow.python.data.util import structure

structure.NoneTensorSpec()
```
<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Support

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

Yes

### Source

binary

### Tensorflow Version

2.13.0

### Custom Code

Yes

### OS Platform and Distribution

_No response_

### 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?

```shell
I have a dataset that returns `None` values. I would like to programatically find and replace the `NoneTensorSpec` values of the spec into a custom value (`None`), but I cannot find `NoneTensorSpec` in the public API and am not sure what the best way to filter for it is.
```


### Standalone code to reproduce the issue

```shell
ds = tf.data.Dataset.from_tensors((3, None))
print(ds.element_spec)
```


### Relevant log output

```shell
`(TensorSpec(shape=(), dtype=tf.int32, name=None), NoneTensorSpec())`
```
</details>