class_docstr: Test class for `BinaryHingeLoss` metric.
class_docstr_tok: ["Test","class","for","`","BinaryHingeLoss","`","metric","."]
docstr: Test functional implementation of metric.
docstr_tok: ["Test","functional","implementation","of","metric","."]
code: def test_binary_hinge_loss_functional(self, inputs, ignore_index):
      """Test functional implementation of metric."""
      preds, target = inputs
      if ignore_index is not None:
          target = inject_ignore_index(target, ignore_index)
      self.run_functional_metric_test(
          preds=preds,
          target=target,
          metric_functional=binary_hinge_loss,
          reference_metric=partial(
              _sklearn_binary_hinge_loss, ignore_index=ignore_index
          ),
          metric_args={
              "ignore_index": ignore_index,
          },
      )
  
imports: from functools import partial
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from scipy.special import softmax
  from sklearn.metrics import hinge_loss
  from sklearn.preprocessing import OneHotEncoder
  from torchmetrics.classification.hinge import BinaryHingeLoss, HingeLoss, MulticlassHingeLoss
  from torchmetrics.functional.classification.hinge import binary_hinge_loss, multiclass_hinge_loss
  from torchmetrics.metric import Metric
  from unittests import NUM_CLASSES
  from unittests.classification.inputs import _binary_cases, _multiclass_cases
  from unittests.helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
label_desc: Use image node_id 2 for calling the TestBinaryHingeLoss obj's underlying member method code with example usage: obj.test_binary_hinge_loss_functional(inputs, ignore_index) without return types