(in_channels, out_channels, kernel_size=1, stride=1, padding=0)
return Sequential(
        Conv2d(in_channels=in_channels, out_channels=in_channels, kernel_size=kernel_size,
               groups=in_channels, stride=stride, padding=padding),
        ReLU(),
        Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=1),
    )
Replace Conv2d with a depthwise Conv2d and Pointwise Conv2d.
Replace Conv2d with a depthwise Conv2d and Pointwise Conv2d.
Replace Conv2d with a depthwise Conv2d and Pointwise Conv2d .
def SeperableConv2d(in_channels, out_channels, kernel_size=1, stride=1, padding=0):
    """Replace Conv2d with a depthwise Conv2d and Pointwise Conv2d.
    """
    return Sequential(
        Conv2d(in_channels=in_channels, out_channels=in_channels, kernel_size=kernel_size,
               groups=in_channels, stride=stride, padding=padding),
        ReLU(),
        Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=1),
    )
def SeperableConv2d ( in_channels , out_channels , kernel_size = 1 , stride = 1 , padding = 0 ) : return Sequential ( Conv2d ( in_channels = in_channels , out_channels = in_channels , kernel_size = kernel_size , groups = in_channels , stride = stride , padding = padding ) , ReLU ( ) , Conv2d ( in_channels = in_channels , out_channels = out_channels , kernel_size = 1 ) , )