In a custom model, you can call the layer using it’s attribute name:
class MyModel(nn.Module):
    def __init__(self):
        super(MyModel, self).__init__()
        self.conv1 = nn.Conv2d(3, 6 ,3, 1, 1)
        
    def forward(self, x):
        x = self.conv1(x)
        return x

model = MyModel()
model.conv1(torch.randn(1, 3, 24, 24))