code: def test_takes_no_log_without_nllloss(
      self, net_cls, module_cls, data
  ):
      net = net_cls(
          module_cls, criterion=nn.CrossEntropyLoss, max_epochs=1
      )
      net.initialize()
  
      mock_loss = Mock(side_effect=nn.NLLLoss())
      net.criterion_.forward = mock_loss
      net.partial_fit(
          *data
      )  # call partial_fit to avoid re-initialization
  
      # check that loss was called with raw probabilities
      for (y_out, _), _ in mock_loss.call_args_list:
          assert not (y_out < 0).all()
          assert torch.isclose(
              torch.ones(len(y_out)), y_out.sum(1)
          ).all()
  
imports: from unittest.mock import Mock
  import numpy
  import pytest
  import torch
  from scipy.special import expit
  from sklearn.base import clone
  from torch import nn
  from skorch.tests.conftest import INFERENCE_METHODS
label_desc: Use image node_id 11 for calling the TestNeuralNet obj's underlying member method code with example usage: obj.test_takes_no_log_without_nllloss(net_cls, module_cls, data) without return types