`_convertMask` already does the right thing if both are None, so you don't need the if here.  Also, I would suggest having `_convertMask` return `weight.view()` so this last line can be included there as well.  Just a little more encapsulation of the functionality.