[resolved] Slice the input variable in custom rnn to use it as a scalar

Hi all,
I am new to pytorch. Went through the pytorch documentation only last week though i heared of pytorch few months back. I feel very comfortable to design my rnn compared to theano, tensorflow. however my architecture requires to slice the input vector to rnn forward function and use the resultant of the slicing operation as a scalar for further computations.
I am getting the resultant of the slicing input variable vector as the tensor variable of size 1 instead of a scalar. Any suggestions please.

For the time being I am fixing with expand operator which i got from previous replies to another question by a wonderful person fmassa

1 Like