class_docstr: Test CNNModule.
class_docstr_tok: ["Test","CNNModule","."]
docstr: Check CNNModule throws exception with invalid non-linear functions.
  
  Args:
      hidden_nonlinear (callable or torch.nn.Module): Non-linear
          functions for hidden layers.
docstr_tok: ["Check","CNNModule","throws","exception","with","invalid","non-linear","functions",".","Args",":","hidden_nonlinear","(","callable","or","torch.nn.Module",")",":","Non-linear","functions","for","hidden","layers","."]
code: def test_no_head_invalid_settings(self, hidden_nonlinear):
      """Check CNNModule throws exception with invalid non-linear functions.
  
      Args:
          hidden_nonlinear (callable or torch.nn.Module): Non-linear
              functions for hidden layers.
  
      """
      expected_msg = "Non linear function .* is not supported"
      with pytest.raises(ValueError, match=expected_msg):
          CNNModule(
              self.input_spec,
              image_format="NCHW",
              hidden_channels=(32,),
              kernel_sizes=(3,),
              strides=(1,),
              hidden_nonlinearity=hidden_nonlinear,
          )
  
file_path: garage/tests/garage/torch/modules/test_cnn_module.py
imports: import pickle
  import akro
  import numpy
  import pytest
  import torch
  import torch.nn
  from garage import InOutSpec
  from garage.torch.modules import CNNModule
  from garage.torch.modules.cnn_module import _check_spec
label_desc: Use image node_id 6 for calling the TestCNNModule obj's underlying member method code with example usage: obj.test_no_head_invalid_settings(hidden_nonlinear) without return types