code: def test_blas_linear_t(
      fp_dtype: torch.dtype, problem_shape: Tuple[int, int, int, int]
  ):
      batch, seq_len, in_features, out_features = problem_shape
      hidden_states = (
          torch.randn(
              batch,
              seq_len,
              in_features,
              dtype=fp_dtype,
              device=get_accelerator().current_device(),
          )
          * 0.1
      )
      weights = (
          torch.randn(
              out_features,
              in_features,
              dtype=fp_dtype,
              device=get_accelerator().current_device(),
          )
          * 0.01
      )
      ds_output = torch.empty(
          batch,
          seq_len,
          out_features,
          dtype=fp_dtype,
          device=get_accelerator().current_device(),
      )
  
      ds_kernel = BlasLibLinear(fp_dtype)
  
      # Transpose the weights then revert to the format we expect.
      weights = weights.t().contiguous()
      weights = weights.t()
      ds_output = ds_kernel(ds_output, hidden_states, weights)
  
      ref_output = reference_implementation(hidden_states, weights)
  
      assert allclose(ds_output, ref_output)
  
file_path: DeepSpeed/tests/unit/inference/v2/kernels/core_ops/test_blas_linear.py
imports: from typing import Tuple
  import pytest
  import torch
  from deepspeed.accelerator import get_accelerator
  from deepspeed.inference.v2.kernels.core_ops import BlasLibLinear
  from ....v2.inference_test_utils import allclose
label_desc: Use image node_id 3 for calling a global function with example usage: test_blas_linear_t(fp_dtype, problem_shape) without return types