Oh nevermind I managed to solve it by adding the line
b_y = b_y.type_as(output)

That made them the same type, so no problem 
Thank you guys so much for all the help, you have been real lifesavers @theairbend3r and @ptrblck <3