class_docstr: Linear DSModule based on BLAS library and standalone bias + activation kernel implementation.
class_docstr_tok: ["Linear","DSModule","based","on","BLAS","library","and","standalone","bias","+","activation","kernel","implementation","."]
code: def forward(
      self,
      hidden_states: torch.Tensor,
      w: torch.Tensor,
      b: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      output = empty_from(
          self._output,
          (hidden_states.shape[0], self._config.out_channels),
      )
  
      if self._is_gated:
          staging_output = empty_from(
              self._double_buffer,
              (hidden_states.shape[0], self._config.out_channels * 2),
          )
          self._linear_impl(staging_output, hidden_states, w)
          self._act_fn(output, staging_output, b)
      else:
          self._linear_impl(output, hidden_states, w)
          self._act_fn(output, b)
  
      return output
  
file_path: DeepSpeed/deepspeed/inference/v2/modules/implementations/linear/blas_fp_linear.py
imports: from typing import Any, Dict, Optional
  import torch
  from deepspeed.accelerator import get_accelerator
  from ....allocator import empty_from
  from ....inference_utils import is_gated
  from ....kernels.core_ops import BlasLibLinear, CUDABiasActivation, CUDAGatedActivation
  from ...interfaces import DSLinearBase, DSLinearRegistry
  from ...configs import DSLinearConfig
  from ....inference_parameter import InferenceParameter
label_desc: Use image node_id 5 for calling the BlasFPLinear obj's underlying member method code with example usage: obj.forward(hidden_states, w, b) and returns: output