code: def test_bias_add_add(batch, image_size, channels):
      activations = torch.randn(
          (batch, channels, image_size, image_size),
          dtype=torch.float16,
          device="cuda",
      ).to(memory_format=torch.channels_last)
      other = torch.randn(
          (batch, channels, image_size, image_size),
          dtype=torch.float16,
          device="cuda",
      ).to(memory_format=torch.channels_last)
      bias = torch.randn((channels), dtype=torch.float16, device="cuda")
  
      ref_vals = ref_bias_add_add(
          activations.clone().detach(), bias, other
      )
      ds_vals = nhwc_bias_add(activations, bias, other=other)
  
      assert allclose(ds_vals, ref_vals)
  
file_path: H2O/h2o_flexgen/benchmark/third_party/DeepSpeed/tests/unit/ops/spatial/test_nhwc_bias_add.py
imports: import pytest
  import torch
  from deepspeed.ops.transformer.inference.bias_add import nhwc_bias_add
label_desc: Use image node_id 5 for calling a global function with example usage: test_bias_add_add(batch, image_size, channels) without return types