Repository: tensorflow
Issue: [TF 2.0] Signature for unranked tensor not working as intended
Labels: stat:awaiting tensorflower,type:bug,comp:apis

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

Bug

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

Yes

### Source

source

### Tensorflow Version

2.14

### Custom Code

Yes

### OS Platform and Distribution

Linux

### Mobile device

_No response_

### Python version

3.9

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

trying to save a model where one of the functions in the model is defined as:

```
class XYZ(tf.keras.models.Model):

  @tf.function(input_signature=[tf.TensorSpec(shape=[None], dtype=tf.float32)])
  def coefficients(self, input_tensor: tf.Tensor):
  ....
  ....
```


When I train the model, and try to build it, I get the following error:

```
File "/build/work/83bb824f51c38f677e7ad84666ae2d5f4deb/google3/runfiles/google3/vr/perception/computational_photography/ml/video_enhancement/nets/hdrnet.py", [line 320](https://cs.corp.google.com/piper///depot/google3/vr/perception/computational_photography/ml/video_enhancement/nets/hdrnet.py?l=320&ws=mnatraj/3402&snapshot=40), in call  *
        grid, _ = self.coefficients(inputs[0])
    File "/build/work/83bb824f51c38f677e7ad84666ae2d5f4deb/google3/runfiles/google3/third_party/tensorflow/python/util/traceback_utils.py", [line 141](https://cs.corp.google.com/piper///depot/google3/third_party/tensorflow/python/util/traceback_utils.py?l=141&ws=mnatraj/3402&snapshot=40), in error_handler  **
        return fn(*args, **kwargs)
    File "/build/work/83bb824f51c38f677e7ad84666ae2d5f4deb/google3/runfiles/google3/third_party/tensorflow/python/eager/polymorphic_function/polymorphic_function.py", [line 820](https://cs.corp.google.com/piper///depot/google3/third_party/tensorflow/python/eager/polymorphic_function/polymorphic_function.py?l=820&ws=mnatraj/3402&snapshot=40), in __call__
        result = self._call(*args, **kwds)
    File "/build/work/83bb824f51c38f677e7ad84666ae2d5f4deb/google3/runfiles/google3/third_party/tensorflow/python/eager/polymorphic_function/polymorphic_function.py", [line 864](https://cs.corp.google.com/piper///depot/google3/third_party/tensorflow/python/eager/polymorphic_function/polymorphic_function.py?l=864&ws=mnatraj/3402&snapshot=40), in _call
        self._initialize(args, kwds, add_initializers_to=initializers)
    File "/build/work/83bb824f51c38f677e7ad84666ae2d5f4deb/google3/runfiles/google3/third_party/tensorflow/python/eager/polymorphic_function/polymorphic_function.py", [line 687](https://cs.corp.google.com/piper///depot/google3/third_party/tensorflow/python/eager/polymorphic_function/polymorphic_function.py?l=687&ws=mnatraj/3402&snapshot=40), in _initialize
        self._variable_creation_fn.get_concrete_function(args, kwds)
    File "/build/work/83bb824f51c38f677e7ad84666ae2d5f4deb/google3/runfiles/google3/third_party/tensorflow/python/eager/polymorphic_function/tracing_compiler.py", [line 182](https://cs.corp.google.com/piper///depot/google3/third_party/tensorflow/python/eager/polymorphic_function/tracing_compiler.py?l=182&ws=mnatraj/3402&snapshot=40), in get_concrete_function
        args, kwargs = function_type_utils.bind_function_inputs(
    File "/build/work/83bb824f51c38f677e7ad84666ae2d5f4deb/google3/runfiles/google3/third_party/tensorflow/python/eager/polymorphic_function/function_type_utils.py", [line 451](https://cs.corp.google.com/piper///depot/google3/third_party/tensorflow/python/eager/polymorphic_function/function_type_utils.py?l=451&ws=mnatraj/3402&snapshot=40), in bind_function_inputs
        raise TypeError(

    TypeError: Binding inputs to tf.function failed due to `Can not cast TensorSpec(shape=(1, 256, 256, 3), dtype=tf.float32, name=None) to TensorSpec(shape=(None,), dtype=tf.float32, name=None)`. Received args: (<tf.Tensor 'Placeholder:0' shape=(1, 256, 256, 3) dtype=float32>,) and kwargs: {} for signature: (input_tensor: TensorSpec(shape=(None,), dtype=tf.float32, name=None)).
```


Shouldn't specifying input signature as `None` imply that you can pass any input into this function? (unranked tensor)

### Standalone code to reproduce the issue

```shell
(no standalone code)
```


### Relevant log output

_No response_</details>