This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added provisions for depthwise convolution
- Loading branch information
1 parent
dfd3598
commit 4bb194e
Showing
2 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import unittest | ||
import torch | ||
from inferno.utils.model_utils import ModelTester | ||
|
||
|
||
class TestConvolutional(unittest.TestCase): | ||
@unittest.skipIf(not torch.cuda.is_available(), "GPU not available.") | ||
def test_bn_relu_depthwise_conv2d_pyinn(self): | ||
from inferno.extensions.layers.convolutional import BNReLUDepthwiseConv2D | ||
model = BNReLUDepthwiseConv2D(10, 'auto', 3) | ||
ModelTester((1, 10, 100, 100), | ||
(1, 10, 100, 100)).cuda()(model) | ||
self.assertTrue(model.depthwise) | ||
self.assertEqual(model.conv.groups, 10) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |