Aborted (core dumped) with `tf.raw_ops.FakeQuantWithMinMaxVarsPerChannelGradient`
Hi @LongZE666 ,

Thanks for reporting. I have reproduced the reported behaviour and attached [gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/1a801be5879be2d1c7484eb265478542/66759.ipynb) here.

The check fail observed when the `inputs` arg `shape` is empty.

Attaching also snapshot of same below.

<img width="1504" alt="Screenshot 2024-05-02 at 9 44 04 AM" src="https://github.com/tensorflow/tensorflow/assets/116063290/34a24455-787c-471d-8fdf-9760c7d7b18f">

### Issue type

Bug

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

Yes

### Source

source

### TensorFlow version

tf 2.16.1

### Custom code

Yes

### OS platform and distribution

Ubuntu 20.04

### Mobile device

_No response_

### Python version

3.11

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Check Failed in `tf.raw_ops.FakeQuantWithMinMaxVarsPerChannelGradient` when the input of inputs is scalar, which causes the program to crash.

### Standalone code to reproduce the issue

```shell
# FakeQuantWithMinMaxVarsPerChannelGradientOp

import tensorflow as tf

num_bits = 8
narrow_range = False
gradients = tf.constant(0, shape=[], dtype=tf.float32)
inputs = tf.constant(0, shape=[], dtype=tf.float32)
min = tf.constant(124, shape=[3,1], dtype=tf.float32)
max = tf.constant(124, shape=[3,1], dtype=tf.float32)
tf.raw_ops.FakeQuantWithMinMaxVarsPerChannelGradient(gradients=gradients, inputs=inputs, min=min, max=max, num_bits=num_bits, narrow_range=narrow_range)
```


### Relevant log output

```shell
2024-05-01 03:10:46.669162: F tensorflow/core/framework/tensor_shape.cc:356] Check failed: d >= 0 (0 vs. -1)
Aborted (core dumped)
```
