-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
__Solution__: When running tests from the command line, ___always__ import the module `-m unittest` and use the verbose (`-v`) flag to see where Python is breaking up. * Then you'll be able to trace down the problem. * Do this a few times, and it will be reflex
- Loading branch information
1 parent
b085293
commit 24bb995
Showing
8 changed files
with
49 additions
and
6 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 |
---|---|---|
@@ -1 +1 @@ | ||
from .nn.morph import once # facility tate "morph.once" | ||
from .nn import once # facilitate "morph.once" |
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,24 @@ | ||
import unittest | ||
|
||
from .widen import widen, nn | ||
from .._error import ValidationError | ||
|
||
|
||
class TestWiden_Functional(unittest.TestCase): | ||
|
||
DUD_LINEAR = nn.Linear(1, 1) | ||
|
||
def test_widen_width_factor_too_small_should_fail(self): | ||
with self.assertRaises(ValidationError): | ||
widen(self.DUD_LINEAR, 0.8) | ||
|
||
def test_widen_width_factor_identity_should_fail(self): | ||
with self.assertRaises(ValidationError): | ||
widen(self.DUD_LINEAR, 1.0) | ||
|
||
def test_widen_width_factor_increases_layer_generously(self): | ||
pass | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
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
File renamed without changes.
File renamed without changes.
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,19 @@ | ||
import unittest | ||
|
||
from .utils import round | ||
|
||
class TestGlobalUtilities(unittest.TestCase): | ||
|
||
def test_round_down(self): | ||
test = 1.2 | ||
expected = 1 | ||
self.assertEqual(expected, round(test), '1.2 should round DOWN, to 1') | ||
|
||
def test_round_up(self): | ||
test = 1.7 | ||
expected = 2 | ||
self.assertEqual(expected, round(test), '1.7 should round UP, to 2') | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |