code: def compute_output_spec(self, image):
      if len(image.shape) == 3:
          return KerasTensor(
              self.size + (image.shape[-1],), dtype=image.dtype
          )
      elif len(image.shape) == 4:
          if self.data_format == "channels_last":
              return KerasTensor(
                  (image.shape[0],) + self.size + (image.shape[-1],),
                  dtype=image.dtype,
              )
          else:
              return KerasTensor(
                  (image.shape[0], image.shape[1]) + self.size,
                  dtype=image.dtype,
              )
      raise ValueError(
          "Invalid input rank: expected rank 3 (single image) "
          "or rank 4 (batch of images). Received input with shape: "
          f"image.shape={image.shape}"
      )
  
imports: from keras import backend
  from keras import ops
  from keras.api_export import keras_export
  from keras.backend import KerasTensor
  from keras.backend import any_symbolic_tensors
  from keras.ops.operation import Operation
  from keras.ops.operation_utils import compute_conv_output_shape
label_desc: Use image node_id 3 for calling the Resize obj's underlying member method code with example usage: obj.compute_output_spec(image) and returns: KerasTensor, KerasTensor, KerasTensor