code: def test_custom_rgb_weights(self, device, dtype):
      B, C, H, W = 2, 3, 4, 4
      img = torch.ones(B, C, H, W, device=device, dtype=dtype)
  
      rgb_weights = torch.tensor([0.5, 0.25, 0.25])
      img_gray = kornia.color.rgb_to_grayscale(
          img, rgb_weights=rgb_weights
      )
      assert img_gray.device == device
      assert img_gray.dtype == dtype
  
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  import kornia
  from kornia.testing import BaseTester, assert_close
  from kornia.utils._compat import torch_version
label_desc: Use image node_id 6 for calling the TestRgbToGrayscale obj's underlying member method code with example usage: obj.test_custom_rgb_weights(device, dtype) without return types