diff --git a/steganogan/critics.py b/steganogan/critics.py
index 0963fd7..301cb61 100644
--- a/steganogan/critics.py
+++ b/steganogan/critics.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 import torch
-import torch.nn as nn
+from torch import nn
 
 
 class BasicCritic(nn.Module):
@@ -13,29 +13,45 @@ class BasicCritic(nn.Module):
     Output: (N, 1)
     """
 
-    def __init__(self, hidden_size):
-
-        super(BasicCritic, self).__init__()
+    def _conv2d(self, in_channels, out_channels):
+        return nn.Conv2d(
+            in_channels=in_channels,
+            out_channels=out_channels,
+            kernel_size=3
+        )
 
-        self.layers = nn.Sequential(
-            nn.Conv2d(in_channels=3, out_channels=hidden_size, kernel_size=3),
+    def _build_models(self):
+        return nn.Sequential(
+            self._conv2d(3, self.hidden_size),
             nn.LeakyReLU(inplace=True),
-            nn.BatchNorm2d(hidden_size),
+            nn.BatchNorm2d(self.hidden_size),
 
-            nn.Conv2d(in_channels=hidden_size, out_channels=hidden_size, kernel_size=3),
+            self._conv2d(self.hidden_size, self.hidden_size),
             nn.LeakyReLU(inplace=True),
-            nn.BatchNorm2d(hidden_size),
+            nn.BatchNorm2d(self.hidden_size),
 
-            nn.Conv2d(in_channels=hidden_size, out_channels=hidden_size, kernel_size=3),
+            self._conv2d(self.hidden_size, self.hidden_size),
             nn.LeakyReLU(inplace=True),
-            nn.BatchNorm2d(hidden_size),
+            nn.BatchNorm2d(self.hidden_size),
 
-            nn.Conv2d(in_channels=hidden_size, out_channels=1, kernel_size=3)
+            self._conv2d(self.hidden_size, 1)
         )
 
-    def forward(self, x):
+    def __init__(self, hidden_size):
+        super().__init__()
+        self.version = '1'
+        self.hidden_size = hidden_size
+        self._models = self._build_models()
+
+    def upgrade_legacy(self):
+        """Transform legacy pretrained models to make them usable with new code versions."""
+        # Transform to version 1
+        if not hasattr(self, 'version'):
+            self._models = self.layers
+            self.version = '1'
 
-        x = self.layers(x)
+    def forward(self, x):
+        x = self._models(x)
         x = torch.mean(x.view(x.size(0), -1), dim=1)
 
         return x
diff --git a/steganogan/decoders.py b/steganogan/decoders.py
index f39828d..f1d150a 100644
--- a/steganogan/decoders.py
+++ b/steganogan/decoders.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 
 import torch
-import torch.nn as nn
+from torch import nn
 
 
 class BasicDecoder(nn.Module):
@@ -13,33 +13,62 @@ class BasicDecoder(nn.Module):
     Output: (N, D, H, W)
     """
 
-    def __init__(self, data_depth, hidden_size):
-
-        super(BasicDecoder, self).__init__()
-
-        self.data_depth = data_depth
+    def _conv2d(self, in_channels, out_channels):
+        return nn.Conv2d(
+            in_channels=in_channels,
+            out_channels=out_channels,
+            kernel_size=3,
+            padding=1
+        )
 
+    def _build_models(self):
         self.layers = nn.Sequential(
-            nn.Conv2d(in_channels=3, out_channels=hidden_size, kernel_size=3, padding=1),
+            self._conv2d(3, self.hidden_size),
             nn.LeakyReLU(inplace=True),
-            nn.BatchNorm2d(hidden_size),
+            nn.BatchNorm2d(self.hidden_size),
 
-            nn.Conv2d(in_channels=hidden_size, out_channels=hidden_size, kernel_size=3, padding=1),
+            self._conv2d(self.hidden_size, self.hidden_size),
             nn.LeakyReLU(inplace=True),
-            nn.BatchNorm2d(hidden_size),
+            nn.BatchNorm2d(self.hidden_size),
 
-            nn.Conv2d(in_channels=hidden_size, out_channels=hidden_size, kernel_size=3, padding=1),
+            self._conv2d(self.hidden_size, self.hidden_size),
             nn.LeakyReLU(inplace=True),
-            nn.BatchNorm2d(hidden_size),
+            nn.BatchNorm2d(self.hidden_size),
 
-            nn.Conv2d(in_channels=hidden_size, out_channels=data_depth, kernel_size=3, padding=1)
+            self._conv2d(self.hidden_size, self.data_depth)
         )
 
+        return [self.layers]
+
+    def __init__(self, data_depth, hidden_size):
+        super().__init__()
+        self.version = '1'
+        self.data_depth = data_depth
+        self.hidden_size = hidden_size
+
+        self._models = self._build_models()
+
+    def upgrade_legacy(self):
+        """Transform legacy pretrained models to make them usable with new code versions."""
+        # Transform to version 1
+        if not hasattr(self, 'version'):
+            self._models = [self.layers]
+
+            self.version = '1'
+
     def forward(self, x):
-        return self.layers(x)
+        x = self._models[0](x)
 
+        if len(self._models) > 1:
+            x_list = [x]
+            for layer in self._models[1:]:
+                x = layer(torch.cat(x_list, dim=1))
+                x_list.append(x)
 
-class DenseDecoder(nn.Module):
+        return x
+
+
+class DenseDecoder(BasicDecoder):
     """
     The DenseDecoder module takes an steganographic image and attempts to decode
     the embedded data tensor.
@@ -47,44 +76,38 @@ class DenseDecoder(nn.Module):
     Input: (N, 3, H, W)
     Output: (N, D, H, W)
     """
-
-    def __init__(self, data_depth, hidden_size):
-        super(DenseDecoder, self).__init__()
-        self.data_depth = data_depth
+    def _build_models(self):
         self.conv1 = nn.Sequential(
-            nn.Conv2d(in_channels=3,
-                      out_channels=hidden_size,
-                      kernel_size=3,
-                      padding=1),
+            self._conv2d(3, self.hidden_size),
             nn.LeakyReLU(inplace=True),
-            nn.BatchNorm2d(hidden_size),
+            nn.BatchNorm2d(self.hidden_size)
         )
+
         self.conv2 = nn.Sequential(
-            nn.Conv2d(in_channels=hidden_size,
-                      out_channels=hidden_size,
-                      kernel_size=3,
-                      padding=1),
+            self._conv2d(self.hidden_size, self.hidden_size),
             nn.LeakyReLU(inplace=True),
-            nn.BatchNorm2d(hidden_size),
+            nn.BatchNorm2d(self.hidden_size)
         )
+
         self.conv3 = nn.Sequential(
-            nn.Conv2d(in_channels=hidden_size * 2,
-                      out_channels=hidden_size,
-                      kernel_size=3,
-                      padding=1),
+            self._conv2d(self.hidden_size * 2, self.hidden_size),
             nn.LeakyReLU(inplace=True),
-            nn.BatchNorm2d(hidden_size),
-        )
-        self.conv4 = nn.Sequential(
-            nn.Conv2d(in_channels=hidden_size * 3,
-                      out_channels=data_depth,
-                      kernel_size=3,
-                      padding=1),
+            nn.BatchNorm2d(self.hidden_size)
         )
 
-    def forward(self, x):
-        x1 = self.conv1(x)
-        x2 = self.conv2(x1)
-        x3 = self.conv3(torch.cat((x1, x2), dim=1))
-        x4 = self.conv4(torch.cat((x1, x2, x3), dim=1))
-        return x4
+        self.conv4 = nn.Sequential(self._conv2d(self.hidden_size * 3, self.data_depth))
+
+        return self.conv1, self.conv2, self.conv3, self.conv4
+
+    def upgrade_legacy(self):
+        """Transform legacy pretrained models to make them usable with new code versions."""
+        # Transform to version 1
+        if not hasattr(self, 'version'):
+            self._models = [
+                self.conv1,
+                self.conv2,
+                self.conv3,
+                self.conv4
+            ]
+
+            self.version = '1'
diff --git a/steganogan/encoders.py b/steganogan/encoders.py
index 04cff12..d1a93c8 100644
--- a/steganogan/encoders.py
+++ b/steganogan/encoders.py
@@ -43,10 +43,17 @@ class BasicEncoder(nn.Module):
 
     def __init__(self, data_depth, hidden_size):
         super().__init__()
+        self.version = '1'
         self.data_depth = data_depth
         self.hidden_size = hidden_size
         self._models = self._build_models()
 
+    def upgrade_legacy(self):
+        """Transform legacy pretrained models to make them usable with new code versions."""
+        # Transform to version 1
+        if not hasattr(self, 'version'):
+            self.version = '1'
+
     def forward(self, image, data):
         x = self._models[0](image)
         x_list = [x]
diff --git a/steganogan/models.py b/steganogan/models.py
index b0cc4cf..78afdbc 100644
--- a/steganogan/models.py
+++ b/steganogan/models.py
@@ -345,5 +345,10 @@ class SteganoGAN(object):
         """Loads an instance of SteganoGAN from the given path."""
         steganogan = torch.load(path, map_location='cpu')
         steganogan.verbose = verbose
+
+        steganogan.encoder.upgrade_legacy()
+        steganogan.decoder.upgrade_legacy()
+        steganogan.critic.upgrade_legacy()
+
         steganogan.set_device(cuda)
         return steganogan

Refactorize critics and decoders
As we added a new Decoder, we can see that the code it's quiet similar and it should be refactorized in order to follow the same structure as `encoders.py`.
Same it's happening for `critics.py`. Refactorizing this now, will save us time in unit tests and if we want to add more architectures in the future it will be easier.
diff --git a/tests/test_critics.py b/tests/test_critics.py
new file mode 100644
index 0000000..5779f76
--- /dev/null
+++ b/tests/test_critics.py
@@ -0,0 +1,103 @@
+# -*- coding: utf-8 -*-
+
+import copy
+from unittest import TestCase
+from unittest.mock import Mock, call, patch
+
+import torch
+
+from steganogan import critics
+from tests.utils import assert_called_with_tensors
+
+
+class TestBasicCritic(TestCase):
+
+    class TestCritic(critics.BasicCritic):
+        def __init__(self):
+            pass
+
+    def setUp(self):
+        self.test_critic = self.TestCritic()
+
+    @patch('steganogan.critics.nn.Conv2d', autospec=True)
+    def test__covn2d(self, conv2d_mock):
+        """Conv2d must be called with given args and kernel_size=3 and padding=1"""
+
+        # run
+        result = self.test_critic._conv2d(2, 4)
+
+        # asserts
+        assert result == conv2d_mock.return_value
+        conv2d_mock.assert_called_once_with(
+            in_channels=2,
+            out_channels=4,
+            kernel_size=3,
+        )
+
+    @patch('steganogan.critics.nn.Sequential')
+    @patch('steganogan.critics.nn.BatchNorm2d')
+    @patch('steganogan.critics.nn.Conv2d')
+    def test___init__(self, conv2d_mock, batchnorm2d_mock, sequential_mock):
+        """Test that conv2d and batchnorm are called when creating a new critic with hidden_size"""
+
+        # run
+        critics.BasicCritic(2)
+
+        # assert
+        expected_batch_calls = [call(2), call(2), call(2)]
+        assert batchnorm2d_mock.call_args_list == expected_batch_calls
+
+        expected_conv2d_calls = [
+            call(in_channels=3, out_channels=2, kernel_size=3),
+            call(in_channels=2, out_channels=2, kernel_size=3),
+            call(in_channels=2, out_channels=2, kernel_size=3),
+            call(in_channels=2, out_channels=1, kernel_size=3)
+        ]
+        assert conv2d_mock.call_args_list == expected_conv2d_calls
+
+    def test_forward(self):
+        """Test the return value of method forward"""
+
+        # setup
+        layer1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
+        test_critic = self.TestCritic()
+        test_critic._models = layer1
+
+        # run
+        image = torch.Tensor([[1, 2], [3, 4]])
+        result = test_critic.forward(image)
+
+        # assert
+        expected = torch.Tensor([[5, 6], [7, 8]])
+        expected = torch.mean(expected.view(expected.size(0), -1), dim=1)
+        assert (result == expected).all()
+
+        call_1 = call(torch.Tensor([[1, 2], [3, 4]]))
+        assert_called_with_tensors(layer1, [call_1])
+
+    def test_upgrade_legacy_without_version(self):
+        """Test that upgrade legacy works, must set _models to layers"""
+
+        # setup
+        self.test_critic.layers = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
+
+        # run
+        self.test_critic.upgrade_legacy()
+
+        # assert
+        assert self.test_critic.version == '1'
+        assert self.test_critic._models == self.test_critic.layers
+
+    @patch('steganogan.critics.nn.Sequential', autospec=True)
+    def test_upgrade_legacy_with_version_1(self, sequential_mock):
+        """The object must be the same and not changed by the method"""
+
+        # setup
+        critic = critics.BasicCritic(1)
+        expected = copy.deepcopy(critic)
+
+        # run
+        critic.upgrade_legacy()
+
+        # assert
+        assert critic.__dict__ == expected.__dict__
diff --git a/tests/test_decoders.py b/tests/test_decoders.py
new file mode 100644
index 0000000..bce9e75
--- /dev/null
+++ b/tests/test_decoders.py
@@ -0,0 +1,190 @@
+# -*- coding: utf-8 -*-
+
+import copy
+from unittest import TestCase
+from unittest.mock import Mock, call, patch
+
+import torch
+
+from steganogan import decoders
+from tests.utils import assert_called_with_tensors
+
+
+class TestBasicDecoder(TestCase):
+
+    class TestDecoder(decoders.BasicDecoder):
+        def __init__(self):
+            pass
+
+    def setUp(self):
+        self.test_decoder = self.TestDecoder()
+
+    @patch('steganogan.decoders.nn.Conv2d', autospec=True)
+    def test__covn2d(self, conv2d_mock):
+        """Conv2d must be called with given args and kernel_size=3 and padding=1"""
+
+        # run
+        result = self.test_decoder._conv2d(2, 4)
+
+        # asserts
+        assert result == conv2d_mock.return_value
+        conv2d_mock.assert_called_once_with(
+            in_channels=2,
+            out_channels=4,
+            kernel_size=3,
+            padding=1
+        )
+
+    @patch('steganogan.decoders.nn.Sequential')
+    @patch('steganogan.decoders.nn.Conv2d')
+    @patch('steganogan.decoders.nn.BatchNorm2d')
+    def test___init__(self, batchnorm_mock, conv2d_mock, sequential_mock):
+        """Test the init params and that the layers are created correctly"""
+
+        # run
+        decoders.BasicDecoder(2, 5)
+
+        # assert
+        expected_batch_calls = [call(5), call(5), call(5)]
+        assert batchnorm_mock.call_args_list == expected_batch_calls
+
+        expected_conv_calls = [
+            call(in_channels=3, out_channels=5, kernel_size=3, padding=1),
+            call(in_channels=5, out_channels=5, kernel_size=3, padding=1),
+            call(in_channels=5, out_channels=5, kernel_size=3, padding=1),
+            call(in_channels=5, out_channels=2, kernel_size=3, padding=1),
+        ]
+        assert conv2d_mock.call_args_list == expected_conv_calls
+
+    def test_upgrade_legacy_without_version(self):
+        """Upgrade legacy must create self._models from conv1, conv2, conv3, conv4"""
+
+        # setup
+        self.test_decoder.layers = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
+
+        # run
+        self.test_decoder.upgrade_legacy()
+
+        # assert
+        assert self.test_decoder._models == [self.test_decoder.layers]
+        assert self.test_decoder.version == '1'
+
+    @patch('steganogan.decoders.nn.Sequential', autospec=True)
+    def test_upgrade_legacy_with_version_1(self, sequential_mock):
+        """The object must be the same and not changed by the method"""
+
+        # setup
+        decoder = decoders.BasicDecoder(1, 1)
+        expected = copy.deepcopy(decoder)
+
+        # run
+        decoder.upgrade_legacy()
+
+        # assert
+        assert decoder.__dict__ == expected.__dict__
+
+    def test_forward_1_layer(self):
+        """If there is only one layer it must be called with image as the only argument."""
+
+        # setup
+        layer1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
+        self.test_decoder._models = [layer1]
+
+        # run
+        image = torch.Tensor([[1, 2], [3, 4]])
+        result = self.test_decoder.forward(image)
+
+        # assert
+        assert (result == torch.Tensor([[5, 6], [7, 8]])).all()
+
+        call_1 = call(torch.Tensor([[1, 2], [3, 4]]))
+        assert_called_with_tensors(layer1, [call_1])
+
+    def test_forward_more_than_2_layers(self):
+        """If there are more than 2 layers, they must be called adding data to each result"""
+
+        # setup
+        layer1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
+        layer2 = Mock(return_value=torch.Tensor([[9, 10], [11, 12]]))
+        layer3 = Mock(return_value=torch.Tensor([[13, 14], [15, 16]]))
+        self.test_decoder._models = [layer1, layer2, layer3]
+
+        # run
+        image = torch.Tensor([[1, 2], [3, 4]])
+        result = self.test_decoder.forward(image)
+
+        # asserts
+        call_layer_1 = call(torch.Tensor([[1, 2], [3, 4]]))
+        call_layer_2 = call(torch.Tensor([[5, 6], [7, 8]]))
+        call_layer_3 = call(torch.Tensor([[5, 6, 9, 10], [7, 8, 11, 12]]))
+
+        assert_called_with_tensors(layer1, [call_layer_1])
+        assert_called_with_tensors(layer2, [call_layer_2])
+        assert_called_with_tensors(layer3, [call_layer_3])
+
+        assert (result == torch.Tensor([[13, 14], [15, 16]])).all()
+
+
+class TestDenseDecoder(TestCase):
+
+    class TestDecoder(decoders.DenseDecoder):
+        def __init__(self):
+            pass
+
+    def test_upgrade_legacy_without_version(self):
+        """Upgrade legacy must create self._models from conv1, conv2, conv3, conv4"""
+
+        # setup
+        test_decoder = self.TestDecoder()  # instance an empty decoder
+        test_decoder.conv1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
+        test_decoder.conv2 = Mock(return_value=torch.Tensor([[9, 10], [11, 12]]))
+        test_decoder.conv3 = Mock(return_value=torch.Tensor([[13, 14], [15, 16]]))
+        test_decoder.conv4 = Mock(return_value=torch.Tensor([[17, 18], [19, 20]]))
+
+        # run
+        test_decoder.upgrade_legacy()
+
+        # assert
+        expected_models = [
+            test_decoder.conv1,
+            test_decoder.conv2,
+            test_decoder.conv3,
+            test_decoder.conv4,
+        ]
+        assert test_decoder._models == expected_models
+        assert test_decoder.version == '1'
+
+    @patch('steganogan.decoders.nn.Sequential', autospec=True)
+    def test_upgrade_legacy_with_version_1(self, sequential_mock):
+        """The object must be the same and not changed by the method"""
+
+        # setup
+        decoder = decoders.DenseDecoder(1, 1)
+        expected = copy.deepcopy(decoder)
+
+        # run
+        decoder.upgrade_legacy()
+
+        # assert
+        assert decoder.__dict__ == expected.__dict__
+
+    @patch('steganogan.decoders.nn.Sequential')
+    @patch('steganogan.decoders.nn.Conv2d')
+    @patch('steganogan.decoders.nn.BatchNorm2d')
+    def test___init__(self, batchnorm_mock, conv2d_mock, sequential_mock):
+        """Test the init params and that the layers are created correctly"""
+
+        # run
+        decoders.DenseDecoder(2, 5)
+
+        # assert
+        expected_batch_calls = [call(5), call(5), call(5)]
+        assert batchnorm_mock.call_args_list == expected_batch_calls
+
+        expected_conv_calls = [
+            call(in_channels=3, out_channels=5, kernel_size=3, padding=1),
+            call(in_channels=5, out_channels=5, kernel_size=3, padding=1),
+            call(in_channels=10, out_channels=5, kernel_size=3, padding=1),
+            call(in_channels=15, out_channels=2, kernel_size=3, padding=1),
+        ]
+        assert conv2d_mock.call_args_list == expected_conv_calls
diff --git a/tests/test_encoders.py b/tests/test_encoders.py
index ee732c7..3cb685e 100644
--- a/tests/test_encoders.py
+++ b/tests/test_encoders.py
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
 
+import copy
 from unittest import TestCase
 from unittest.mock import Mock, call, patch
 
@@ -34,8 +35,32 @@ class TestBasicEncoder(TestCase):
             padding=1
         )
 
+    def test_upgrade_legacy_no_version(self):
+        """Test that we set a version to our encoder for future code changes"""
+
+        # run
+        self.test_encoder.upgrade_legacy()
+
+        # assert
+        assert self.test_encoder.version == '1'
+
+    @patch('steganogan.encoders.nn.Sequential', autospec=True)
+    def test_upgrade_legacy_with_version_1(self, sequential_mock):
+        """The object must be the same and not changed by the method"""
+
+        # setup
+        encoder = encoders.BasicEncoder(1, 1)
+        expected = copy.deepcopy(encoder)
+
+        # run
+        encoder.upgrade_legacy()
+
+        # assert
+        assert encoder.__dict__ == expected.__dict__
+
     def test_forward_1_layer(self):
         """If there is only one layer it must be called with image as the only argument."""
+
         # setup
         layer1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
         self.test_encoder._models = [layer1]
@@ -44,14 +69,15 @@ class TestBasicEncoder(TestCase):
         image = torch.Tensor([[1, 2], [3, 4]])
         result = self.test_encoder.forward(image, 'some_data')
 
-        call_1 = call(torch.Tensor([[1, 2], [3, 4]]))
-
         # assert
         assert (result == torch.Tensor([[5, 6], [7, 8]])).all()
+
+        call_1 = call(torch.Tensor([[1, 2], [3, 4]]))
         assert_called_with_tensors(layer1, [call_1])
 
     def test_forward_more_than_2_layers(self):
         """If there are more than 2 layers, they must be called adding data to each result"""
+
         # setup
         layer1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
         layer2 = Mock(return_value=torch.Tensor([[9, 10], [11, 12]]))
@@ -76,6 +102,7 @@ class TestBasicEncoder(TestCase):
 
     def test_forward_add_image(self):
         """If add_image is true, image must be added to the result."""
+
         # setup
         self.test_encoder.add_image = True
         layer1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
@@ -127,6 +154,7 @@ class TestResidualEncoder(TestCase):
 
     def test_forward_1_layer(self):
         """If there is only one layer it must be called with image as the only argument."""
+
         # setup
         layer1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
         self.test_encoder._models = [layer1]
@@ -135,14 +163,15 @@ class TestResidualEncoder(TestCase):
         image = torch.Tensor([[1, 2], [3, 4]])
         result = self.test_encoder.forward(image, 'some_data')
 
-        call_1 = call(torch.Tensor([[1, 2], [3, 4]]))
-
         # assert
         assert (result == torch.Tensor([[6, 8], [10, 12]])).all()
+
+        call_1 = call(torch.Tensor([[1, 2], [3, 4]]))
         assert_called_with_tensors(layer1, [call_1])
 
     def test_forward_more_than_2_layers(self):
         """If there are more than 2 layers, they must be called adding data to each result"""
+
         # setup
         layer1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
         layer2 = Mock(return_value=torch.Tensor([[9, 10], [11, 12]]))
@@ -194,6 +223,7 @@ class TestDenseEncoder(TestCase):
 
     def test_forward_1_layer(self):
         """If there is only one layer it must be called with image as the only argument."""
+
         # setup
         layer1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
         self.test_encoder._models = [layer1]
@@ -202,14 +232,15 @@ class TestDenseEncoder(TestCase):
         image = torch.Tensor([[1, 2], [3, 4]])
         result = self.test_encoder.forward(image, 'some_data')
 
-        call_1 = call(torch.Tensor([[1, 2], [3, 4]]))
-
         # assert
         assert (result == torch.Tensor([[6, 8], [10, 12]])).all()
+
+        call_1 = call(torch.Tensor([[1, 2], [3, 4]]))
         assert_called_with_tensors(layer1, [call_1])
 
     def test_forward_more_than_2_layers(self):
         """If there are more than 2 layers, they must be called adding data to each result"""
+
         # setup
         layer1 = Mock(return_value=torch.Tensor([[5, 6], [7, 8]]))
         layer2 = Mock(return_value=torch.Tensor([[9, 10], [11, 12]]))

pip install -e .[dev]
parse_log_pytest
pytest
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
async-generator==1.10
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
autoflake==1.4
autopep8==2.0.0
Babel==2.11.0
backcall==0.2.0
bleach==4.1.0
bump2version==1.0.1
bumpversion==0.6.0
certifi==2021.5.30
cffi==1.15.1
charset-normalizer==2.0.12
colorama==0.4.5
comm==0.1.4
coverage==6.2
cryptography==40.0.2
dataclasses==0.8
decorator==5.1.1
defusedxml==0.7.1
distlib==0.3.9
docutils==0.17.1
entrypoints==0.4
execnet==1.9.0
filelock==3.4.1
flake8==5.0.4
idna==3.10
imageio==2.15.0
imagesize==1.4.1
importlib-metadata==4.2.0
importlib-resources==5.4.0
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
ipykernel==5.5.6
ipython==7.16.3
ipython-genutils==0.2.0
ipywidgets==7.8.5
isort==5.10.1
jedi==0.17.2
jeepney==0.7.1
Jinja2==3.0.3
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==7.1.2
jupyter-console==6.4.3
jupyter-core==4.9.2
jupyterlab-pygments==0.1.2
jupyterlab_widgets==1.1.11
keyring==23.4.1
m2r==0.3.1
MarkupSafe==2.0.1
mccabe==0.7.0
mistune==0.8.4
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
nbclient==0.5.9
nbconvert==6.0.7
nbformat==5.1.3
nest-asyncio==1.6.0
notebook==6.4.10
numpy==1.19.5
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pandocfilters==1.5.1
parso==0.7.1
pexpect==4.9.0
pickleshare==0.7.5
Pillow==8.4.0
pkginfo==1.10.0
platformdirs==2.4.0
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
prometheus-client==0.17.1
prompt-toolkit==3.0.36
ptyprocess==0.7.0
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pycodestyle==2.9.1
pycparser==2.21
pyflakes==2.5.0
Pygments==2.14.0
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pyrsistent==0.18.0
pytest==6.2.4
pytest-asyncio==0.16.0
pytest-cov==4.0.0
pytest-mock==3.6.1
pytest-xdist==3.0.2
python-dateutil==2.9.0.post0
pytz==2025.2
pyzmq==25.1.2
qtconsole==5.2.2
QtPy==2.0.1
readme-renderer==34.0
reedsolo==1.7.0
requests==2.27.1
requests-toolbelt==1.0.0
rfc3986==1.5.0
scikit-learn==0.19.1
scipy==1.5.4
SecretStorage==3.3.3
Send2Trash==1.8.3
six==1.17.0
snowballstemmer==2.2.0
Sphinx==4.3.2
sphinx-rtd-theme==1.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
-e git+https://github.com/DAI-Lab/SteganoGAN.git@7b5457edc88715a3e8885dcbc20468c739155024#egg=steganogan
terminado==0.12.1
testpath==0.6.0
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
tomli==1.2.3
torch==1.10.2
torchvision==0.2.1
tornado==6.1
tox==3.28.0
tqdm==4.28.1
traitlets==4.3.3
twine==3.8.0
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
urllib3==1.26.20
virtualenv==20.16.2
watchdog==2.3.1
wcwidth==0.2.13
webencodings==0.5.1
widgetsnbextension==3.6.10
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: SteganoGAN
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - argon2-cffi==21.3.0
      - argon2-cffi-bindings==21.2.0
      - async-generator==1.10
      - autoflake==1.4
      - autopep8==2.0.0
      - babel==2.11.0
      - backcall==0.2.0
      - bleach==4.1.0
      - bump2version==1.0.1
      - bumpversion==0.6.0
      - cffi==1.15.1
      - charset-normalizer==2.0.12
      - colorama==0.4.5
      - comm==0.1.4
      - coverage==6.2
      - cryptography==40.0.2
      - dataclasses==0.8
      - decorator==5.1.1
      - defusedxml==0.7.1
      - distlib==0.3.9
      - docutils==0.17.1
      - entrypoints==0.4
      - execnet==1.9.0
      - filelock==3.4.1
      - flake8==5.0.4
      - idna==3.10
      - imageio==2.15.0
      - imagesize==1.4.1
      - importlib-metadata==4.2.0
      - importlib-resources==5.4.0
      - ipykernel==5.5.6
      - ipython==7.16.3
      - ipython-genutils==0.2.0
      - ipywidgets==7.8.5
      - isort==5.10.1
      - jedi==0.17.2
      - jeepney==0.7.1
      - jinja2==3.0.3
      - jsonschema==3.2.0
      - jupyter==1.0.0
      - jupyter-client==7.1.2
      - jupyter-console==6.4.3
      - jupyter-core==4.9.2
      - jupyterlab-pygments==0.1.2
      - jupyterlab-widgets==1.1.11
      - keyring==23.4.1
      - m2r==0.3.1
      - markupsafe==2.0.1
      - mccabe==0.7.0
      - mistune==0.8.4
      - nbclient==0.5.9
      - nbconvert==6.0.7
      - nbformat==5.1.3
      - nest-asyncio==1.6.0
      - notebook==6.4.10
      - numpy==1.19.5
      - pandocfilters==1.5.1
      - parso==0.7.1
      - pexpect==4.9.0
      - pickleshare==0.7.5
      - pillow==8.4.0
      - pkginfo==1.10.0
      - platformdirs==2.4.0
      - prometheus-client==0.17.1
      - prompt-toolkit==3.0.36
      - ptyprocess==0.7.0
      - pycodestyle==2.9.1
      - pycparser==2.21
      - pyflakes==2.5.0
      - pygments==2.14.0
      - pyrsistent==0.18.0
      - pytest-asyncio==0.16.0
      - pytest-cov==4.0.0
      - pytest-mock==3.6.1
      - pytest-xdist==3.0.2
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyzmq==25.1.2
      - qtconsole==5.2.2
      - qtpy==2.0.1
      - readme-renderer==34.0
      - reedsolo==1.7.0
      - requests==2.27.1
      - requests-toolbelt==1.0.0
      - rfc3986==1.5.0
      - scikit-learn==0.19.1
      - scipy==1.5.4
      - secretstorage==3.3.3
      - send2trash==1.8.3
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==4.3.2
      - sphinx-rtd-theme==1.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - terminado==0.12.1
      - testpath==0.6.0
      - tomli==1.2.3
      - torch==1.10.2
      - torchvision==0.2.1
      - tornado==6.1
      - tox==3.28.0
      - tqdm==4.28.1
      - traitlets==4.3.3
      - twine==3.8.0
      - urllib3==1.26.20
      - virtualenv==20.16.2
      - watchdog==2.3.1
      - wcwidth==0.2.13
      - webencodings==0.5.1
      - widgetsnbextension==3.6.10
prefix: /opt/conda/envs/SteganoGAN

tests/test_critics.py::TestBasicCritic::test__covn2d tests/test_critics.py::TestBasicCritic::test_forward tests/test_critics.py::TestBasicCritic::test_upgrade_legacy_with_version_1 tests/test_critics.py::TestBasicCritic::test_upgrade_legacy_without_version tests/test_decoders.py::TestBasicDecoder::test__covn2d tests/test_decoders.py::TestBasicDecoder::test_forward_1_layer tests/test_decoders.py::TestBasicDecoder::test_forward_more_than_2_layers tests/test_decoders.py::TestBasicDecoder::test_upgrade_legacy_with_version_1 tests/test_decoders.py::TestBasicDecoder::test_upgrade_legacy_without_version tests/test_decoders.py::TestDenseDecoder::test_upgrade_legacy_with_version_1 tests/test_decoders.py::TestDenseDecoder::test_upgrade_legacy_without_version tests/test_encoders.py::TestBasicEncoder::test_upgrade_legacy_no_version tests/test_encoders.py::TestBasicEncoder::test_upgrade_legacy_with_version_1
tests/test_critics.py::TestBasicCritic::test___init__ tests/test_decoders.py::TestBasicDecoder::test___init__ tests/test_decoders.py::TestDenseDecoder::test___init__ tests/test_encoders.py::TestBasicEncoder::test__covn2d tests/test_encoders.py::TestBasicEncoder::test_forward_1_layer tests/test_encoders.py::TestBasicEncoder::test_forward_add_image tests/test_encoders.py::TestBasicEncoder::test_forward_more_than_2_layers tests/test_encoders.py::TestResidualEncoder::test__covn2d tests/test_encoders.py::TestResidualEncoder::test_forward_1_layer tests/test_encoders.py::TestResidualEncoder::test_forward_more_than_2_layers tests/test_encoders.py::TestDenseEncoder::test__covn2d tests/test_encoders.py::TestDenseEncoder::test_forward_1_layer tests/test_encoders.py::TestDenseEncoder::test_forward_more_than_2_layers
steganogan/models.py steganogan/critics.py steganogan/decoders.py steganogan/encoders.py
steganogan/models.py steganogan/critics.py steganogan/decoders.py steganogan/encoders.py