class_docstr: Test agents for distilling Transformer generator models.
docstr: Calculate and check distillation loss terms.
  
  Given the input opt, run eval and check each of the loss terms to make sure that
  they match what is expected.
docstr_tok: ["Calculate","and","check","distillation","loss","terms",".","Given","the","input","opt",",","run","eval","and","check","each","of","the","loss","terms","to","make","sure","that","they","match","what","is","expected","."]
code: def _check_losses(
      self,
      opt: Opt,
      test_name: str,
      data_regression: DataRegressionFixture,
  ):
      """
      Calculate and check distillation loss terms.
  
      Given the input opt, run eval and check each of the loss terms to make sure that
      they match what is expected.
      """
      valid, _ = testing_utils.eval_model(opt, skip_test=True)
      losses = {}
      loss_types = self.LOSS_TYPES[test_name]
      for loss_type in loss_types:
          losses[loss_type] = round_sig(valid[loss_type].value(), sig=6)
      basename = self._get_model_identifier() + "_" + test_name
      data_regression.check(losses, basename=basename)
  
imports: import random
  from abc import ABC, abstractmethod
  from math import floor, log10
  from typing import Dict
  import numpy
  import pytest
  import torch
  from pytest_regressions.data_regression import DataRegressionFixture
  import parlai.utils.testing
  from parlai.core.opt import Opt
  from parlai.core.teachers import register_teacher, DialogTeacher
  from parlai.utils.data import DatatypeHelper
  from parlai.zoo.bart.build import download
  from parlai.zoo.blender.blender_90M import download
label_desc: Use image node_id 9 for calling the AbstractTestDistillation obj's underlying member method code with example usage: obj._check_losses(opt, test_name, data_regression) without return types