Factor out _zeros() and _ones() block.
Rename padding_ones -> extra_mask.
Implement resize().