code: def test_forward(num_classes, shape):
      """Tests that a tensor can be given to the model forward and gives the correct output size."""
      model = TemplateSKLearnClassifier(
          num_features=shape[1],
          num_classes=num_classes,
      )
      model.eval()
  
      row = torch.rand(*shape)
  
      out = model(row)
      assert out.shape == (shape[0], num_classes)
  
imports: import os
  import numpy
  import pytest
  import torch
  from flash import Trainer
  from flash.core.data.io.input import DataKeys
  from flash.core.utilities.imports import _SKLEARN_AVAILABLE, _TOPIC_CORE_AVAILABLE
  from flash.template import TemplateSKLearnClassifier
  from flash.template.classification.data import TemplateData
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: test_forward(num_classes, shape) without return types