the most generic way would be to do something like this (which is not broadcasting, but explicit expanding):
output = a.expand_as(b)*b

Edit:
if you want to do it with broadcasting, you can simply do
output = a * b

if the shapes cannot be broadcasted, an error will be raised, but you will also receive this error if you use the explicit approach