# Path: cortex/built_ins/networks/convnets.py
# class SimpleNet(nn.Module):
# 
#     def __init__(self):
#         super(SimpleNet, self).__init__()
#         self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
#         self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
#         self.conv2_drop = nn.Dropout2d()
#         self.fc1 = nn.Linear(320, 50)
#         self.fc2 = nn.Linear(50, 10)
# 
#     def forward(self, x):
#         x = F.relu(F.max_pool2d(self.conv1(x), 2))
#         x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2))
#         x = x.view(-1, 320)
#         x = F.relu(self.fc1(x))
#         x = F.dropout(x, training=self.training)
#         x = self.fc2(x)
#         return F.log_softmax(x)
# 
# def infer_conv_size(w, k, s, p):
#     x = (w - k + 2 * p) // s + 1
#     return x
# 
# Path: cortex/built_ins/networks/modules.py
# class View(nn.Module):
#     def __init__(self, *shape):
#         super(View, self).__init__()
#         self.shape = shape
# 
#     def forward(self, input):
#         return input.view(*self.shape)


from cortex.built_ins.networks.convnets import SimpleNet, infer_conv_size
from torch import nn
from cortex.built_ins.networks.modules import View
import torch
    p = 1
    output = simple_conv_encoder_image_classification.next_size(
        dim_x, dim_y, k, s, p)
    expected_value = infer_conv_size(dim_x, k, s, p)
    assert isinstance(output, tuple)
    assert output[0] == expected_value and output[1] == expected_value


def test_infer_conv_size():
    """

    Asserts: True if output is result of formula
             (w - k + 2 * p) // s + 1

    """
    w = 32
    k = 4
    s = 2
    p = 1
    output = infer_conv_size(w, k, s, p)
    assert output == (w - k + 2 * p) // s + 1


def test_simple_net_init():
    """

    Asserts:  True if SimpleNet is being initialize with right default
             layers and parameters.

    """

# Path: cortex/built_ins/networks/convnets.py
# class SimpleNet(nn.Module):
# 
#     def __init__(self):
#         super(SimpleNet, self).__init__()
#         self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
#         self.conv2 = nn.Conv2d(10, 20, kernel_size=5)
#         self.conv2_drop = nn.Dropout2d()
#         self.fc1 = nn.Linear(320, 50)
#         self.fc2 = nn.Linear(50, 10)
# 
#     def forward(self, x):
#         x = F.relu(F.max_pool2d(self.conv1(x), 2))
#         x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2))
#         x = x.view(-1, 320)
#         x = F.relu(self.fc1(x))
#         x = F.dropout(x, training=self.training)
#         x = self.fc2(x)
#         return F.log_softmax(x)
# 
# def infer_conv_size(w, k, s, p):
#     x = (w - k + 2 * p) // s + 1
#     return x
# 
# Path: cortex/built_ins/networks/modules.py
# class View(nn.Module):
#     def __init__(self, *shape):
#         super(View, self).__init__()
#         self.shape = shape
# 
#     def forward(self, input):
#         return input.view(*self.shape)


# Path: tests/built_ins/networks/test_convnets.py
from cortex.built_ins.networks.convnets import SimpleNet, infer_conv_size
from torch import nn
from cortex.built_ins.networks.modules import View
import torch

    p = 1
    output = simple_conv_encoder_image_classification.next_size(
        dim_x, dim_y, k, s, p)
    expected_value = infer_conv_size(dim_x, k, s, p)
    assert isinstance(output, tuple)
    assert output[0] == expected_value and output[1] == expected_value


def test_infer_conv_size():
    """

    Asserts: True if output is result of formula
             (w - k + 2 * p) // s + 1

    """
    w = 32
    k = 4
    s = 2
    p = 1
    output = infer_conv_size(w, k, s, p)
    assert output == (w - k + 2 * p) // s + 1


def test_simple_net_init():
    """

    Asserts:  True if SimpleNet is being initialize with right default
             layers and parameters.

    """

    simple_net = SimpleNet()