class_docstr: Concatenate variables along a new axis.
class_docstr_tok: ["Concatenate","variables","along","a","new","axis","."]
code: def forward(self, inputs):
      xp = backend.get_array_module(*inputs)
      if hasattr(xp, "stack"):
          return (xp.stack(inputs, axis=self.axis),)
      else:
          # Old numpy does not have numpy.stack.
          return (
              xp.concatenate(
                  [xp.expand_dims(x, self.axis) for x in inputs],
                  self.axis,
              ),
          )
  
file_path: chainer/chainer/functions/array/stack.py
imports: import chainer
  from chainer import backend
  from chainer import function_node
  from chainer.utils import type_check
  import chainerx
label_desc: Use image node_id 3 for calling the Stack obj's underlying member method code with example usage: obj.forward(inputs) and returns: xp, xp