How to weight multiple losses?

The weight should be python built-in type or tensor? Or both work?

Both approximations should work.