code: def check_classifier_no_given_weight():
      device = get_current_device()
      dtype = torch.float32
      INPUT_SIZE = HIDDEN_SIZE
      OUTPUT_SIZE = NUM_CLASSES
  
      j = gpc.get_local_rank(ParallelMode.PARALLEL_2P5D_ROW)
      i = gpc.get_local_rank(ParallelMode.PARALLEL_2P5D_COL)
  
      layer = Classifier2p5D(INPUT_SIZE, OUTPUT_SIZE)
  
      A_shape = (BATCH_SIZE, SEQ_LENGTH, INPUT_SIZE)
      A_master = torch.randint(5, A_shape, dtype=dtype, device=device)
      torch.distributed.broadcast(A_master, src=0)
      A = torch.chunk(A_master, TESSERACT_DIM, dim=0)[i]
      A = torch.chunk(A, TESSERACT_DIM, dim=-1)[j]
      A = A.clone()
      A.requires_grad = True
  
      W_shape = (OUTPUT_SIZE, INPUT_SIZE)
      W_master = torch.randint(5, W_shape, dtype=dtype, device=device)
      torch.distributed.broadcast(W_master, src=0)
      # W = torch.chunk(W_master, TESSERACT_DIM, dim=-1)[j]
      W = torch.chunk(W_master, TESSERACT_DIM, dim=-1)[j]
      W = torch.chunk(W, TESSERACT_DIM, dim=-1)[i]
      W = W.clone()
      layer.weight.data.copy_(W)
      # W.requires_grad = True
  
      B_shape = (OUTPUT_SIZE,)
      B_master = torch.randint(5, B_shape, dtype=dtype, device=device)
      torch.distributed.broadcast(B_master, src=0)
      # B = torch.chunk(B_master, TESSERACT_DIM, dim=0)[j]
      B = B_master.clone()
      layer.bias.data.copy_(B)
  
      out = layer(A)
  
      A_master = A_master.clone()
      A_master.requires_grad = True
      W_master = W_master.clone()
      W_master.requires_grad = True
      B_master = B_master.clone()
      B_master.requires_grad = True
      C_master = (
          torch.matmul(A_master, W_master.transpose(0, 1)) + B_master
      )
      C = torch.chunk(C_master, TESSERACT_DIM, dim=0)[i]
      # C = torch.chunk(C, TESSERACT_DIM, dim=-1)[j]
  
      check_equal(out, C)
      print_rank_0("classifier (no given weight) forward: pass")
  
      grad_shape = C_master.shape
      grad_master = torch.randn(
          grad_shape, dtype=dtype, device=get_current_device()
      )
      torch.distributed.broadcast(grad_master, src=0)
      grad = torch.chunk(grad_master, TESSERACT_DIM, dim=0)[i]
      # grad = torch.chunk(grad, TESSERACT_DIM, dim=-1)[j]
      grad = grad.clone()
      out.backward(grad)
  
      grad_master = grad_master.clone()
      C_master.backward(grad_master)
      A_grad = A_master.grad
      A_grad = torch.chunk(A_grad, TESSERACT_DIM, dim=0)[i]
      A_grad = torch.chunk(A_grad, TESSERACT_DIM, dim=-1)[j]
      check_equal(A_grad, A.grad)
  
      W_grad = W_master.grad
      W_grad = torch.chunk(W_grad, TESSERACT_DIM, dim=-1)[j]
      W_grad = torch.chunk(W_grad, TESSERACT_DIM, dim=-1)[i]
      check_equal(W_grad, layer.weight.grad)
  
      B_grad = B_master.grad
      # B_grad = torch.chunk(B_grad, TESSERACT_DIM, dim=0)[j]
      # if i == 0:
      check_equal(B_grad, layer.bias.grad)
  
      print_rank_0("classifier (no given weight) backward: pass")
  
file_path: colossalai/tests/test_legacy/test_layers/test_2p5d/checks_2p5d/check_layer_2p5d.py
imports: import torch
  from torch.nn import Parameter
  from colossalai.legacy.context.parallel_mode import ParallelMode
  from colossalai.legacy.core import global_context
  from colossalai.legacy.nn import Classifier2p5D, CrossEntropyLoss2p5D, Embedding2p5D, LayerNorm2p5D, Linear2p5D, PatchEmbedding2p5D, VanillaClassifier, VanillaPatchEmbedding, VocabParallelClassifier2p5D, VocabParallelCrossEntropyLoss2p5D, VocabParallelEmbedding2p5D
  from colossalai.legacy.utils import print_rank_0
  from colossalai.utils import get_current_device
  from .common import *
label_desc: Use image node_id 6 for calling a global function with example usage: check_classifier_no_given_weight() without return types