# Path: deep_architect/helpers/pytorch_support.py
# def siso_pytorch_module(name, compile_fn, name_to_hyperp, scope=None):
#     return PyTorchModule(name, compile_fn, name_to_hyperp, ['in'], ['out'],
#                          scope).get_io()


from math import ceil
from deep_architect.helpers.pytorch_support import siso_pytorch_module
import torch
import torch.nn as nn
import torch.nn.functional as F
            x = padding(di['in'])
            return {'out': conv(x)}

        return fn, [conv, padding]

    return siso_pytorch_module(
        'Conv2D', compile_fn, {
            'num_filters': h_num_filters,
            'filter_width': h_filter_width,
            'stride': h_stride,
            'use_bias': h_use_bias,
            'dilation_rate': h_dilation_rate,
        })


def max_pool2d(h_kernel_size, h_stride=1):

    def compile_fn(di, dh):
        (_, _, height, width) = di['in'].size()
        padding = nn.ZeroPad2d(
            calculate_same_padding(height, width, dh['stride'],
                                   dh['kernel_size']))
        max_pool = nn.MaxPool2d(dh['kernel_size'], stride=dh['stride'])

        def fn(di):
            x = padding(di['in'])
            return {'out': max_pool(x)}

        return fn, [padding, max_pool]


# Path: deep_architect/helpers/pytorch_support.py
# def siso_pytorch_module(name, compile_fn, name_to_hyperp, scope=None):
#     return PyTorchModule(name, compile_fn, name_to_hyperp, ['in'], ['out'],
#                          scope).get_io()


# Path: deep_architect/contrib/deep_learning_backend/pytorch_ops.py
from math import ceil
from deep_architect.helpers.pytorch_support import siso_pytorch_module
import torch
import torch.nn as nn
import torch.nn.functional as F

            x = padding(di['in'])
            return {'out': conv(x)}

        return fn, [conv, padding]

    return siso_pytorch_module(
        'Conv2D', compile_fn, {
            'num_filters': h_num_filters,
            'filter_width': h_filter_width,
            'stride': h_stride,
            'use_bias': h_use_bias,
            'dilation_rate': h_dilation_rate,
        })


def max_pool2d(h_kernel_size, h_stride=1):

    def compile_fn(di, dh):
        (_, _, height, width) = di['in'].size()
        padding = nn.ZeroPad2d(
            calculate_same_padding(height, width, dh['stride'],
                                   dh['kernel_size']))
        max_pool = nn.MaxPool2d(dh['kernel_size'], stride=dh['stride'])

        def fn(di):
            x = padding(di['in'])
            return {'out': max_pool(x)}

        return fn, [padding, max_pool]


    return siso_pytorch_module('MaxPool2D', compile_fn, {