code: def test_defaults(self):
      state = {torchbearer.CRITERION: "not a criterion"}
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "acc")
  
      state = {torchbearer.CRITERION: nn.CrossEntropyLoss()}
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "acc")
  
      state = {torchbearer.CRITERION: nn.NLLLoss()}
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "acc")
  
      state = {torchbearer.CRITERION: F.cross_entropy}
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "acc")
  
      state = {torchbearer.CRITERION: F.nll_loss}
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "acc")
  
      state = {torchbearer.CRITERION: nn.MSELoss()}
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "mse")
  
      state = {torchbearer.CRITERION: F.mse_loss}
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "mse")
  
      state = {torchbearer.CRITERION: nn.BCELoss()}
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "binary_acc")
  
      state = {torchbearer.CRITERION: nn.BCEWithLogitsLoss()}
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "binary_acc")
  
      state = {torchbearer.CRITERION: F.binary_cross_entropy}
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "binary_acc")
  
      state = {
          torchbearer.CRITERION: F.binary_cross_entropy_with_logits
      }
      metric = DefaultAccuracy()
      metric.reset(state)
      self.assertEqual(metric.name, "binary_acc")
  
file_path: torchbearer/tests/metrics/test_default.py
imports: import unittest
  from mock import Mock, patch
  import torch.nn
  import torch.nn.functional
  import torchbearer
  from torchbearer.metrics import DefaultAccuracy
label_desc: Use image node_id 1 for calling the TestDefaultAccuracy obj's underlying member method code with example usage: obj.test_defaults() without return types