class_docstr: Concatenates two length padded (B, L, H) arrays (of different lenghts).
class_docstr_tok: ["Concatenates","two","length","padded","(","B",",","L",",","H",")","arrays","(","of","different","lenghts",")","."]
code: def forward(self, inputs):
      vec_e, vec_d, mask_e, tok_e, tok_d = inputs
  
      # In training/eval mode or at the first step predict mode i.e. when
      # state.shape is (), i.e. at first step, we return the concatenated output.
      if self._mode != "predict" or not self.state.shape:
          # Now state.shape will not evaluate to false.
          self.state = self.state.reshape((1,))
          return _ConcatWithPadding(vec_e, vec_d, mask_e), tok_e, tok_d
  
      # In predict mode and on subsequent steps (i.e. after the first step) we
      # don't concatenate anymore, but just return the decoder vector.
      return vec_d, tok_e, tok_d
  
imports: from trax import fastmath
  from trax import layers
  from trax.fastmath import numpy
  from trax.models.research import configurable_transformer
label_desc: Use image node_id 3 for calling the ConcatWithPadding obj's underlying member method code with example usage: obj.forward(inputs) and returns: vec_d,  tok_e,  tok_d, _ConcatWithPadding,  tok_e,  tok_d