

def compute_tensor(self, input_var, mask=None, additional_inputs=None, steps=None, backward=False):
    backward = (backward if backward else self._go_backwards)
    steps = (steps if steps else main_states._steps)
    mask = (mask if mask else self._mask)
    if (mask and (self._input_type == 'one')):
        raise Exception('Mask only works with sequence input')
    init_state_map = self.get_initial_states(input_var)
    if (self._input_type == 'sequence'):
        input_var = input_var.dimshuffle((1, 0, 2))
        seq_map = self.get_step_inputs(input_var, mask=mask, additional_inputs=additional_inputs)
    else:
        init_state_map[self.main_state] = input_var
        seq_map = self.get_step_inputs(None, mask=mask, additional_inputs=additional_inputs)
    (retval_map, _) = Scanner(self.step, sequences=seq_map, outputs_info=init_state_map, n_steps=steps, go_backwards=backward).compute()
    main_states = retval_map[self.main_state]
    if (self._output_type == 'one'):
        return main_states[(- 1)]
    elif (self._output_type == 'sequence'):
        main_states = main_states.dimshuffle((1, 0, 2))
        if mask:
            main_states *= mask.dimshuffle((0, 1, 'x'))
        return main_states

dataset/ETHPy150Open zomux/deepy/deepy/layers/recurrent.py RecurrentLayer.compute_tensor/VarMisuse@47/55 `self`->`main_states`