code: def test_corner_case_due_to_dtype():
      """Test that metric works with edge case where the precision is really important for the right result.
  
      See issue: https://github.com/Lightning-AI/torchmetrics/issues/1907
  
      """
      preds = torch.tensor(
          [
              0.9000,
              0.9000,
              0.9000,
              0.9000,
              0.9000,
              0.8000,
              0.8000,
              0.0100,
              0.3300,
              0.3400,
              0.9900,
              0.6100,
          ],
          dtype=torch.float64,
      )
      target = torch.tensor([1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0])
  
      assert np.allclose(
          ECE(99).measure(preds.numpy(), target.numpy()),
          binary_calibration_error(preds, target, n_bins=99),
      ), "The metric should be close to the netcal implementation"
      assert np.allclose(
          ECE(100).measure(preds.numpy(), target.numpy()),
          binary_calibration_error(preds, target, n_bins=100),
      ), "The metric should be close to the netcal implementation"
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from netcal.metrics import ECE, MCE
  from scipy.special import expit
  from scipy.special import softmax
  from torchmetrics.classification.calibration_error import BinaryCalibrationError, CalibrationError, MulticlassCalibrationError
  from torchmetrics.functional.classification.calibration_error import binary_calibration_error, multiclass_calibration_error
  from torchmetrics.metric import Metric
  from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_1_13
  from unittests import NUM_CLASSES
  from unittests.classification.inputs import _binary_cases, _multiclass_cases
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
label_desc: Use image node_id 4 for calling a global function with example usage: test_corner_case_due_to_dtype() without return types