-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create auto-resizing version of the Torrin network
- Loading branch information
1 parent
f71b09c
commit 1eee9bb
Showing
2 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
14 changes: 11 additions & 3 deletions
14
src/qusi/internal/torran_model.py → src/qusi/internal/torrin_model.py
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,31 @@ | ||
import torch | ||
|
||
from qusi.internal.torrin_model import Torrin | ||
|
||
|
||
def test_lengths_give_correct_output_size(): | ||
torrin50 = Torrin.new(input_length=50) | ||
|
||
output50 = torrin50(torch.arange(50, dtype=torch.float32).reshape([1, 50])) | ||
|
||
assert output50.shape == torch.Size([1]) | ||
|
||
torrin1000 = Torrin.new(input_length=1000) | ||
|
||
output1000 = torrin1000(torch.arange(1000, dtype=torch.float32).reshape([1, 1000])) | ||
|
||
assert output1000.shape == torch.Size([1]) | ||
|
||
torrin3673 = Torrin.new(input_length=3673) | ||
|
||
output3673 = torrin3673(torch.arange(3673, dtype=torch.float32).reshape([1, 3673])) | ||
|
||
assert output3673.shape == torch.Size([1]) | ||
|
||
torrin100000 = Torrin.new(input_length=100000) | ||
|
||
output100000 = torrin100000( | ||
torch.arange(100000, dtype=torch.float32).reshape([1, 100000]) | ||
) | ||
|
||
assert output100000.shape == torch.Size([1]) |