code: def test_adversarial_feat_loss(self):
      adv = MultiScaleDiscriminator()
      optimizer = torch.optim.Adam(
          adv.parameters(),
          lr=1e-4,
      )
      loss, loss_real, loss_fake = (
          get_adv_criterion("mse"),
          get_real_criterion("mse"),
          get_fake_criterion("mse"),
      )
      feat_loss = FeatureMatchingLoss()
      adv_loss = AdversarialLoss(
          adv, optimizer, loss, loss_real, loss_fake, feat_loss
      )
  
      B, C, T = 4, 1, random.randint(1000, 5000)
      real = torch.randn(B, C, T)
      fake = torch.randn(B, C, T)
  
      loss, loss_feat = adv_loss(fake, real)
  
      assert isinstance(loss, torch.Tensor) and isinstance(
          loss.item(), float
      )
      assert isinstance(loss_feat, torch.Tensor) and isinstance(
          loss.item(), float
      )
  
file_path: audiocraft/tests/adversarial/test_losses.py
imports: import pytest
  import random
  import torch
  from audiocraft.adversarial import AdversarialLoss, get_adv_criterion, get_real_criterion, get_fake_criterion, FeatureMatchingLoss, MultiScaleDiscriminator
label_desc: Use image node_id 2 for calling the TestAdversarialLoss obj's underlying member method code with example usage: obj.test_adversarial_feat_loss() without return types