class_docstr: Test class for `RelativeSquaredError` metric.
class_docstr_tok: ["Test","class","for","`","RelativeSquaredError","`","metric","."]
docstr: Test the differentiability of the metric, according to its `is_differentiable` attribute.
docstr_tok: ["Test","the","differentiability","of","the","metric",",","according","to","its","`","is_differentiable","`","attribute","."]
code: def test_rse_differentiability(
      self, squared, preds, target, ref_metric, num_outputs
  ):
      """Test the differentiability of the metric, according to its `is_differentiable` attribute."""
      self.run_differentiability_test(
          preds=preds,
          target=target,
          metric_module=partial(
              RelativeSquaredError, num_outputs=num_outputs
          ),
          metric_functional=relative_squared_error,
          metric_args={"squared": squared},
      )
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from torchmetrics.functional import relative_squared_error
  from torchmetrics.regression import RelativeSquaredError
  from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_2_1
  from unittests import BATCH_SIZE, NUM_BATCHES, _Input
  from unittests.helpers import seed_all
  from unittests.helpers.testers import MetricTester
label_desc: Use image node_id 3 for calling the TestRelativeSquaredError obj's underlying member method code with example usage: obj.test_rse_differentiability(squared, preds, target, ref_metric, num_outputs) without return types