<s> from __future__ import absolute_import , print_function , division <EOL> import theano <EOL> import theano . tensor as T <EOL> from six . moves import xrange <EOL> k = T . iscalar ( "<STR_LIT:k>" ) ; A = T . vector ( "<STR_LIT:A>" ) <EOL> def inner_fct ( prior_result , A ) : return prior_result * A <EOL> result , updates = theano . scan ( fn = inner_fct , <EOL> outputs_info = T . ones_like ( A ) , <EOL> non_sequences = A , n_steps = k ) <EOL> final_result = result [ - <NUM_LIT:1> ] <EOL> power = theano . function ( inputs = [ A , k ] , outputs = final_result , <EOL> updates = updates ) <EOL> print ( power ( list ( range ( <NUM_LIT:10> ) ) , <NUM_LIT:2> ) ) </s>
