Solved by HaFred in post #3 
              
              
                Thank you for your reply, you are totally right and I solve it with some help from stackoverflow. Specifically, I messed up the index of self.theta which makes me do eta * [] so it raised the error. 
Sorry for the ‘unrelated’ post. 
(https://stackoverflow.com/questions/63302668/why-does-items-work-f…