Modifying a pretrained model in PyTorch
I am attempting to modify this particular section of code in the mobilenetv2 model
(17): InvertedResidual(
      (conv): Sequential(
        (0): ConvBNReLU(
          (0): Conv2d(160, 960, kernel_size=(1, 1), stride=(1, 1), bias=False)
          (1): BatchNorm2d(960, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (2): ReLU6(inplace=True)
        )

After the conv2d section, I want to add a max-pooling layer but I am having trouble figuring out to do so. I suspect it would be similar to doing something like this:
MobileNet.features = nn.Sequential(nn.Linear(1280, 1000), nn.LeakyReLU(), nn.Dropout(0.5), nn.Linear(1000,3), nn.LogSoftmax(dim=1))

Where I would do something like:
MobileNet.features[17].conv[0] = nn.ConvBRELU(nn.Conv2d(),nn.maxpool,nn.BatchNorm(),nn.ReLU())

but when I tried that I got the error message module 'torch.nn' has no attribute 'ConvBNReLU'
How can I go about modifying the provided section of code?

ConvBNReLU is not a nn module -- you can find all the available nn modules here.
It is defined in torchvision. You would need to import it by
from torchvision.models.mobilenet import ConvBNReLU

While you cannot just insert a max-pool in ConvBNReLU, it is just inherited from nn.Sequential and helps to specify the parameters. I would sugget you to make a new class, copying the code from ConvBNReLU, and insert a max-pool there.
class ConvMaxPoolBNReLU(nn.Sequential):
    def __init__(self, in_planes, out_planes, kernel_size=3, stride=1, groups=1, norm_layer=None):
        padding = (kernel_size - 1) // 2
        if norm_layer is None:
            norm_layer = nn.BatchNorm2d
        super(ConvBNReLU, self).__init__(
            nn.Conv2d(in_planes, out_planes, kernel_size, stride, padding, groups=groups, bias=False),
            nn.MaxPool2d(2),
            norm_layer(out_planes),
            nn.ReLU6(inplace=True)
        )

