Solved by Steven_Mugisha in post #2 
              
              
                The reason for the above scenario is that tensors are mutable objects therefore they are changeable in-place 
This implies that when you call b(a), instead of a new local variable a being created in the function scope, a ‘reference’ to a will be made and a[0] will be assigned the value 3. 
However i…