class_docstr: A special loss containing a BatchNorm module
class_docstr_tok: ["A","special","loss","containing","a","BatchNorm","module"]
code: def from_config(
      cls, config: Dict[str, Any]
  ) -> "BatchNormCrossEntropyLoss":
      assert "num_classes" in config
      return cls(config["num_classes"])
  
imports: import copy
  import unittest
  from typing import Any, Dict
  from unittest import mock
  import torch
  import torch.nn
  from classy_vision.generic.util import get_checkpoint_dict
  from classy_vision.losses import ClassyLoss, register_loss
  from classy_vision.tasks import build_task, FineTuningTask
  from classy_vision.trainer import LocalTrainer
  from test.generic.config_utils import get_fast_test_task_config
  from test.generic.utils import compare_model_state
  from torch.nn.modules.loss import CrossEntropyLoss
label_desc: Use image node_id 2 for calling the BatchNormCrossEntropyLoss obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls