Beispiel #1
0
 def _forward(batch, state, ops):
     data = None
     for op in ops:
         data = get_inputs_by_op(op, batch, data)
         data = op.forward(data, state)
         if op.outputs:
             write_outputs_by_key(batch, data, op.outputs)
Beispiel #2
0
 def _preprocess_fn(feature, forward_ops, state):
     data = None
     for op in forward_ops:
         data = get_inputs_by_op(op, feature, data)
         data = op.forward(data, state)
         if op.outputs:
             feature = write_outputs_by_key(feature, data, op.outputs)
     return feature
Beispiel #3
0
 def _preprocessing(self, feature, mode):
     data = None
     for op in self.mode_ops[mode]:
         data = get_inputs_by_op(op, feature, data)
         data = op.forward(data, state={"mode": mode})
         if op.outputs:
             feature = write_outputs_by_key(feature, data, op.outputs)
     return feature