It creates a binary tensor whose values are calculated with respect to the comparison of l and b. The .view(2, 1) is for broadcasting purposes.
>>> import torch
>>> l = torch.randint(3, (2, ))
>>> l # the original form of the lengths
tensor([2, 1])
>>> l += torch.arange(2) * 3
>>> l # the modified form of the lengths for the comparison to work
tensor([2, 4])
>>> b = torch.arange(6).view(2, 3)
>>> b
tensor([[0, 1, 2],
        [3, 4, 5]])
>>> b < l.view(2, 1)
tensor([[1, 1, 0],
        [1, 0, 0]], dtype=torch.uint8)

The trick is to use torch.arange and then compare it to the indices you want to create the effect of zeroing starting from a given point. I hope it is clear !