Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6799 do not compare types #6801

Merged
merged 2 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:

- name: Build
run: |
rm -rf /opt/hostedtoolcache/{node,go,Ruby,Java*}
ls -al /opt/hostedtoolcache
rm -rf /usr/share/dotnet/
python -m pip install -U pip wheel
python -m pip install -r requirements-dev.txt
BUILD_MONAI=1 ./runtests.sh --build
Expand Down
2 changes: 1 addition & 1 deletion tests/test_selfattention.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_access_attn_matrix(self):
# be not able to access the matrix
no_matrix_acess_blk = SABlock(hidden_size=hidden_size, num_heads=num_heads, dropout_rate=dropout_rate)
no_matrix_acess_blk(torch.randn(input_shape))
assert type(no_matrix_acess_blk.att_mat) == torch.Tensor
assert isinstance(no_matrix_acess_blk.att_mat, torch.Tensor)
# no of elements is zero
assert no_matrix_acess_blk.att_mat.nelement() == 0

Expand Down
2 changes: 1 addition & 1 deletion tests/test_transformerblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_access_attn_matrix(self):
hidden_size=hidden_size, mlp_dim=mlp_dim, num_heads=num_heads, dropout_rate=dropout_rate
)
no_matrix_acess_blk(torch.randn(input_shape))
assert type(no_matrix_acess_blk.attn.att_mat) == torch.Tensor
assert isinstance(no_matrix_acess_blk.attn.att_mat, torch.Tensor)
# no of elements is zero
assert no_matrix_acess_blk.attn.att_mat.nelement() == 0

Expand Down
2 changes: 1 addition & 1 deletion tests/test_vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
# no data in the matrix
no_matrix_acess_blk = ViT(in_channels=in_channels, img_size=img_size, patch_size=patch_size)
no_matrix_acess_blk(torch.randn(in_shape))
assert type(no_matrix_acess_blk.blocks[0].attn.att_mat) == torch.Tensor
assert isinstance(no_matrix_acess_blk.blocks[0].attn.att_mat, torch.Tensor)

Check warning on line 163 in tests/test_vit.py

View check run for this annotation

Codecov / codecov/patch

tests/test_vit.py#L163

Added line #L163 was not covered by tests
# no of elements is zero
assert no_matrix_acess_blk.blocks[0].attn.att_mat.nelement() == 0

Expand Down
Loading