TfLiteStatus EvalImpl(TfLiteContext* context, bool requires_broadcast,
                      const TfLiteTensor* input1, const TfLiteTensor* input2,
                      TfLiteTensor* output) {
  const T* denominator_data = GetTensorData<T>(input2);

  if (input2->type == kTfLiteInt32 || input2->type == kTfLiteInt64) {
    // Validate the denominator only for integer.
    const int num_elements = NumElements(input2);
    for (int i = 0; i < num_elements; ++i) {
      if (denominator_data[i] == 0) {
        context->ReportError(context, "Division by 0");
        return kTfLiteError;
      }
    }
  }
  if (requires_broadcast) {
    reference_ops::BroadcastBinaryFunction4DSlow<T, T, T>(
        GetTensorShape(input1), GetTensorData<T>(input1),
        GetTensorShape(input2), denominator_data, GetTensorShape(output),
        GetTensorData<T>(output), reference_ops::FloorMod<T>);
  } else {
    reference_ops::BinaryFunction<T, T, T>(
        GetTensorShape(input1), GetTensorData<T>(input1),
        GetTensorShape(input2), GetTensorData<T>(input2),
        GetTensorShape(output), GetTensorData<T>(output),
        reference_ops::FloorMod<T>);
  }

  return kTfLiteOk;
}
TfLiteStatus EvalImpl(TfLiteContext* context, bool requires_broadcast,
                      const TfLiteTensor* input1, const TfLiteTensor* input2,
                      TfLiteTensor* output) {
  const T* denominator_data = GetTensorData<T>(input2);

  if (input2->type == kTfLiteInt32 || input2->type == kTfLiteInt64) {
     
    const int num_elements = NumElements(input2);
    for (int i = 0; i < num_elements; ++i) {
      if (denominator_data[i] == 0) {
        context->ReportError(context, "Division by 0");
        return kTfLiteError;
      }
    }
  }
  if (requires_broadcast) {
    reference_ops::BroadcastBinaryFunction4DSlow<T, T, T>(
        GetTensorShape(input1), GetTensorData<T>(input1),
        GetTensorShape(input2), denominator_data, GetTensorShape(output),
        GetTensorData<T>(output), reference_ops::FloorMod<T>);
  } else {
    reference_ops::BinaryFunction<T, T, T>(
        GetTensorShape(input1), GetTensorData<T>(input1),
        GetTensorShape(input2), GetTensorData<T>(input2),
        GetTensorShape(output), GetTensorData<T>(output),
        reference_ops::FloorMod<T>);
  }

  return kTfLiteOk;
}