`tf.raw_ops.RecordInput` aborts with negative `batch_size`
[gist](https://colab.research.google.com/drive/1ehgZdC8sSkTuZJ0BqLuFOHHoG24gm45L?usp=sharing) Hi @Sehun0819 ;

I have replicated the issue with tf-nightly(2.17.0-dev20240218) version.Attached snapshot below for reference.


<img width="1488" alt="Screenshot 2024-02-19 at 13 41 47" src="https://github.com/tensorflow/tensorflow/assets/116063290/95e4b31a-d22a-4ed0-a5fe-733e8aa7e04f">
 The same behaviour exists in Tf2.15v also. 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/62977">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/62977">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

tf 2.17

### Custom code

Yes

### OS platform and distribution

Linux Ubuntu 22.04 LTS

### Mobile device

_No response_

### Python version

3.11.7

### Bazel version

6.5.0

### GCC/compiler version

clang 16

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

`tf.raw_ops.RecordInput` aborts with negative `batch_size`

### Standalone code to reproduce the issue

```shell
import tensorflow as tf

tf.raw_ops.RecordInput(
    file_pattern="a",
    file_random_seed=301,
    file_shuffle_shift_ratio=0,
    file_buffer_size=10000,
    file_parallelism=16,
    batch_size=-1,
    compression_type='',
    name=None)
```


### Relevant log output

```shell
2024-02-16 16:31:18.185444: F tensorflow/core/framework/tensor_shape.cc:201] Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Expected shape dimensions to be non-negative, got -1
Aborted (core dumped)
```
