class_docstr: Base class for op test that compares the output with Chainer
  implementation.
  
  It must be used in conjunction with `op_test` decorator.
  
  Examples:
  
  @op_utils.op_test(['native:0', 'cuda:0'])
  class test_conv(op_utils.ChainerOpTest):
  
      def setup(self, float_dtype):
          self.dtype = float_dtype
  
      def generate_inputs(self):
          dtype = self.dtype
          x = numpy.random.uniform(-1, 1, (1, 3)).astype(dtype)
          w = numpy.random.uniform(-1, 1, (5, 3)).astype(dtype)
          b = numpy.random.uniform(-1, 1, (5,)).astype(dtype)
          return x, w, b
  
      def forward_chainerx(self, inputs):
          x, w, b = inputs
          y = chainerx.conv(x, w, b, self.stride, self.pad, self.cover_all)
          return y,
  
      def forward_chainer(self, inputs):
          x, w, b = inputs
          y = chainer.functions.convolution_nd(
              x, w, b, self.stride, self.pad, self.cover_all)
          return y,
  
  In this example, `float_dtype` is a Pytest fixture for parameterizing
  floating-point dtypes (i.e. float16, float32, float64). As seen from
  this, arguments in the `setup` method are treated as Pytest fixtures.
  
  Test implementations must at least override the following methods:
    * `generate_inputs`: Generates inputs to the test target.
    * `forward_chainerx`: Forward implementation using ChainerX.
    * `forward_chainer`: Forward reference implementation using Chainer.
  
  It can have the same attributes as `chainer.testing.FunctionTestCase`.
class_docstr_tok: ["Base","class","for","op","test","that","compares","the","output","with","Chainer","implementation",".","It","must","be","used","in","conjunction","with","`","op_test","`","decorator",".","Examples",":","@","op_utils.op_test","(","[","'native:0","'",",","'cuda:0","'","]",")","class","test_conv","(","op_utils.ChainerOpTest",")",":","def","setup","(","self",",","float_dtype",")",":","self.dtype","=","float_dtype","def","generate_inputs","(","self",")",":","dtype","=","self.dtype","x","=","numpy.random.uniform","(","-1",",","1",",","(","1",",","3",")",")",".astype","(","dtype",")","w","=","numpy.random.uniform","(","-1",",","1",",","(","5",",","3",")",")",".astype","(","dtype",")","b","=","numpy.random.uniform","(","-1",",","1",",","(","5",",",")",")",".astype","(","dtype",")","return","x",",","w",",","b","def","forward_chainerx","(","self",",","inputs",")",":","x",",","w",",","b","=","inputs","y","=","chainerx.conv","(","x",",","w",",","b",",","self.stride",",","self.pad",",","self.cover_all",")","return","y",",","def","forward_chainer","(","self",",","inputs",")",":","x",",","w",",","b","=","inputs","y","=","chainer.functions.convolution_nd","(","x",",","w",",","b",",","self.stride",",","self.pad",",","self.cover_all",")","return","y",",","In","this","example",",","`","float_dtype","`","is","a","Pytest","fixture","for","parameterizing","floating-point","dtypes","(","i.e",".","float16",",","float32",",","float64",")",".","As","seen","from","this",",","arguments","in","the","`","setup","`","method","are","treated","as","Pytest","fixtures",".","Test","implementations","must","at","least","override","the","following","methods",":","*","`","generate_inputs","`",":","Generates","inputs","to","the","test","target",".","*","`","forward_chainerx","`",":","Forward","implementation","using","ChainerX",".","*","`","forward_chainer","`",":","Forward","reference","implementation","using","Chainer",".","It","can","have","the","same","attributes","as","`","chainer.testing.FunctionTestCase","`","."]
code: def forward_chainerx(self, inputs):
      raise NotImplementedError(
          "Op test implementation must override `forward_chainerx`."
      )
  
imports: import inspect
  import sys
  import unittest
  import numpy
  import pytest
  import chainer
  import chainer.testing
  import chainerx
label_desc: Use image node_id 2 for calling the ChainerOpTest obj's underlying member method code with example usage: obj.forward_chainerx(inputs) without return types