class_docstr: Mock TransformerLM for testing autoregressive sampling routines.
  
  Mimics the behavior of a perfectly-trained, deterministic TransformerLM.
  Allows to specify the \sigma^* -> \sigma function implemented by the model
  and to make assertions about the input sequence passed to the model.
  
  Supports two modes: stateful "predict" for fast inference, and stateless
  non-"predict" ("train", "eval" etc).
  
  Useful for testing any logic that relies on autoregressive sampling, as it
  removes the additional layer of complexity related to training a model or
  maintaining a pretrained one. Makes the tests run MUCH faster.
  
  Does not support acceleration. Do not wrap in tl.Accelerate().
class_docstr_tok: ["Mock","TransformerLM","for","testing","autoregressive","sampling","routines",".","Mimics","the","behavior","of","a","perfectly-trained",",","deterministic","TransformerLM",".","Allows","to","specify","the","\\sigma^","*","-",">","\\sigma","function","implemented","by","the","model","and","to","make","assertions","about","the","input","sequence","passed","to","the","model",".","Supports","two","modes",":","stateful","``","predict","''","for","fast","inference",",","and","stateless","non-","''","predict","''","(","``","train","''",",","``","eval","''","etc",")",".","Useful","for","testing","any","logic","that","relies","on","autoregressive","sampling",",","as","it","removes","the","additional","layer","of","complexity","related","to","training","a","model","or","maintaining","a","pretrained","one",".","Makes","the","tests","run","MUCH","faster",".","Does","not","support","acceleration",".","Do","not","wrap","in","tl.Accelerate","(",")","."]
code: def _output_symbols_eval(self, input_symbols, prediction_buffer):
      del prediction_buffer
  
      # Add a leading 0 token to imitate ShiftRight.
      input_symbols = np.concatenate(([0], input_symbols))
  
      # Call sequence_fn repeatedly along the input sequence.
      return np.array(
          [
              self._sequence_fn(input_symbols[:end])
              for end in range(1, len(input_symbols))
          ]
      )
  
file_path: trax/trax/layers/test_utils.py
imports: import copy
  import functools
  import numpy
  from trax import fastmath
  from trax import layers
  from trax import shapes
label_desc: Use image node_id 5 for calling the MockTransformerLM obj's underlying member method code with example usage: obj._output_symbols_eval(input_symbols, prediction_buffer) and returns: np