code: def check_classifier_no_given_weight():
      device = get_current_device()
      dtype = torch.float32
  
      i = gpc.get_local_rank(ParallelMode.PARALLEL_1D)
  
      env.parallel_input_1d = False
      parallel_input_1d = env.parallel_input_1d
      layer = Classifier1D(HIDDEN_SIZE, NUM_CLASSES, bias=True)
      layer.to(dtype).to(device)
  
      layer_master = VanillaClassifier(
          HIDDEN_SIZE, NUM_CLASSES, bias=True
      )
      layer_master = layer_master.to(dtype).to(device)
  
      W_master = layer_master.weight.data
      dist.broadcast(W_master, src=0)
      W = torch.chunk(W_master, DEPTH, dim=-1)[i]
      layer.weight.data.copy_(W)
      B_master = layer_master.bias.data
      dist.broadcast(B_master, src=0)
      B = B_master.clone()
      layer.bias.data.copy_(B)
  
      A_shape = (BATCH_SIZE, SEQ_LENGTH, HIDDEN_SIZE)
      A_master = torch.randn(A_shape, dtype=dtype, device=device)
      dist.broadcast(A_master, src=0)
      if parallel_input_1d:
          A = torch.chunk(A_master, DEPTH, dim=-1)[i]
          A = A.clone()
      else:
          A = A_master.clone()
      A.requires_grad = True
  
      out = layer(A)
  
      A_master = A_master.clone()
      A_master.requires_grad = True
      C_master = layer_master(A_master)
      C = C_master.clone()
  
      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=device)
      dist.broadcast(grad_master, src=0)
      grad = grad_master.clone()
      out.backward(grad)
  
      grad_master = grad_master.clone()
      C_master.backward(grad_master)
      A_grad = A_master.grad
      if parallel_input_1d:
          A_grad = torch.chunk(A_grad, DEPTH, dim=-1)[i]
      check_equal(A_grad, A.grad)
  
      W_grad = layer_master.weight.grad
      W_grad = torch.chunk(W_grad, DEPTH, dim=-1)[i]
      check_equal(W_grad, layer.weight.grad)
  
      B_grad = layer_master.bias.grad
      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_1d/checks_1d/check_layer_1d.py
imports: import torch
  import torch.distributed
  from torch.nn import Parameter
  from colossalai.legacy.context.parallel_mode import ParallelMode
  from colossalai.legacy.core import global_context
  from colossalai.legacy.global_variables import tensor_parallel_env
  from colossalai.legacy.nn import Classifier1D, Embedding1D, Linear1D_Col, Linear1D_Row, VanillaClassifier, VocabParallelClassifier1D, VocabParallelCrossEntropyLoss1D, VocabParallelEmbedding1D
  from colossalai.legacy.utils import print_rank_0
  from colossalai.utils import get_current_device
  from .common import BATCH_SIZE, DEPTH, HIDDEN_SIZE, NUM_CLASSES, SEQ_LENGTH, VOCAB_SIZE, check_equal
label_desc: Use image node_id 5 for calling a global function with example usage: check_classifier_no_given_weight() without return types