class_docstr: Vision transformer as per https://arxiv.org/abs/2010.11929.
class_docstr_tok: ["Vision","transformer","as","per","https",":","\/\/arxiv.org\/abs\/2010.11929","."]
code: def check_params(params):
      p = params
      err_str = "Input shape indivisible by patch size"
      assert p["image_size"] % p["patch_size"] == 0, err_str
      assert p["stem_type"] in [
          "patchify",
          "conv",
      ], "Unexpected stem type"
      assert p["cls_type"] in [
          "token",
          "pooled",
      ], "Unexpected classifier mode"
      if p["stem_type"] == "conv":
          err_str = "Conv stem layers mismatch"
          assert len(p["c_stem_dims"]) == len(
              p["c_stem_strides"]
          ), err_str
          assert len(p["c_stem_strides"]) == len(
              p["c_stem_kernels"]
          ), err_str
          err_str = "Stem strides unequal to patch size"
          assert p["patch_size"] == np.prod(
              p["c_stem_strides"]
          ), err_str
          err_str = "Stem output dim unequal to hidden dim"
          assert p["c_stem_dims"][-1] == p["hidden_d"], err_str
  
imports: import math
  import numpy
  import torch
  from pycls.core.config import cfg
  from pycls.models.blocks import activation, conv2d, conv2d_cx, layernorm, layernorm_cx, linear, linear_cx, MultiheadAttention, norm2d, norm2d_cx, patchify2d, patchify2d_cx
  from torch.nn import init, Module, Parameter
label_desc: Use image node_id 2 for calling the ViT obj's underlying member method code with example usage: obj.check_params(params) without return types