-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
[mod] #70
[mod] #70
Conversation
vyomakesh09
commented
Dec 28, 2023
modified: tests/models/test_vit.py modified: tests/nn/modules/test_linearactivation.py modified: tests/structs/test_localtransformer.py modified: tests/structs/test_transformer.py modified: zeta/nn/modules/test_dense_connect.py
self.assertTrue( | ||
torch.allclose(output[:, 10:], self.submodule(x)) | ||
) # Check submodule output | ||
assert output.shape == (32, 15) # Check output shape |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
torch.allclose(output[:, 10:], self.submodule(x)) | ||
) # Check submodule output | ||
assert output.shape == (32, 15) # Check output shape | ||
assert torch.allclose(output[:, :10], x) # Check if input is preserved |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
) # Check submodule output | ||
assert output.shape == (32, 15) # Check output shape | ||
assert torch.allclose(output[:, :10], x) # Check if input is preserved | ||
assert torch.allclose( |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
DenseBlock.forward.__doc__ | ||
) # Check if forward has a docstring | ||
def test_initialization(dense_block): | ||
assert isinstance(dense_block.submodule, nn.Linear) # Check submodule type |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
) # Check if forward has a docstring | ||
def test_initialization(dense_block): | ||
assert isinstance(dense_block.submodule, nn.Linear) # Check submodule type | ||
assert dense_block.submodule.in_features == 10 # Check input features |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
def test_initialization(dense_block): | ||
assert isinstance(dense_block.submodule, nn.Linear) # Check submodule type | ||
assert dense_block.submodule.in_features == 10 # Check input features | ||
assert dense_block.submodule.out_features == 5 # Check output features |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
if __name__ == "__main__": | ||
unittest.main() | ||
def test_docstrings(): | ||
assert ( |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
assert ( | ||
DenseBlock.__init__.__doc__ is not None | ||
) # Check if __init__ has a docstring | ||
assert ( |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
) # Check submodule output | ||
assert output.shape == (32, 15) # Check output shape | ||
assert torch.allclose(output[:, :10], x) # Check if input is preserved | ||
assert torch.allclose( |
Check warning
Code scanning / Bandit (reported by Codacy)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Warning test
torch.allclose(output[:, 10:], self.submodule(x)) | ||
) # Check submodule output | ||
assert output.shape == (32, 15) # Check output shape | ||
assert torch.allclose(output[:, :10], x) # Check if input is preserved |
Check warning
Code scanning / Bandit (reported by Codacy)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Warning test
assert ( | ||
DenseBlock.__init__.__doc__ is not None | ||
) # Check if __init__ has a docstring | ||
assert ( |
Check warning
Code scanning / Bandit (reported by Codacy)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Warning test
self.assertTrue( | ||
torch.allclose(output[:, 10:], self.submodule(x)) | ||
) # Check submodule output | ||
assert output.shape == (32, 15) # Check output shape |
Check warning
Code scanning / Bandit (reported by Codacy)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Warning test
if __name__ == "__main__": | ||
unittest.main() | ||
def test_docstrings(): | ||
assert ( |
Check warning
Code scanning / Bandit (reported by Codacy)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Warning test
DenseBlock.forward.__doc__ | ||
) # Check if forward has a docstring | ||
def test_initialization(dense_block): | ||
assert isinstance(dense_block.submodule, nn.Linear) # Check submodule type |
Check warning
Code scanning / Bandit (reported by Codacy)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Warning test
def test_initialization(dense_block): | ||
assert isinstance(dense_block.submodule, nn.Linear) # Check submodule type | ||
assert dense_block.submodule.in_features == 10 # Check input features | ||
assert dense_block.submodule.out_features == 5 # Check output features |
Check warning
Code scanning / Bandit (reported by Codacy)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Warning test
) # Check if forward has a docstring | ||
def test_initialization(dense_block): | ||
assert isinstance(dense_block.submodule, nn.Linear) # Check submodule type | ||
assert dense_block.submodule.in_features == 10 # Check input features |
Check warning
Code scanning / Bandit (reported by Codacy)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Warning test
x = torch.randn(32, 10) | ||
output = self.dense_block(x) | ||
def test_forward(dense_block): | ||
x = torch.randn(32, 10) |
Check warning
Code scanning / Pylint (reported by Codacy)
Variable name "x" doesn't conform to snake_case naming style Warning test
import sys | ||
|
||
|
||
def delete_pycache(directory): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing function docstring Warning
print("Usage: python delete_pycache.py <directory>") | ||
sys.exit(1) | ||
|
||
directory = sys.argv[1] |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "directory" doesn't conform to UPPER_CASE naming style Warning
@@ -0,0 +1,19 @@ | |||
import os |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing module docstring Warning
self.submodule = nn.Linear(10, 5) | ||
self.dense_block = DenseBlock(self.submodule) | ||
@pytest.fixture | ||
def dense_block(): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing function docstring Warning test
self.assertIsNotNone( | ||
DenseBlock.forward.__doc__ | ||
) # Check if forward has a docstring | ||
def test_initialization(dense_block): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing function docstring Warning test
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() | ||
def test_docstrings(): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing function docstring Warning test
def test_forward(self): | ||
x = torch.randn(32, 10) | ||
output = self.dense_block(x) | ||
def test_forward(dense_block): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing function docstring Warning test
@@ -3,7 +3,7 @@ | |||
import torch | |||
from zeta.structs import LocalTransformer | |||
from torch.autograd import gradcheck | |||
from zeta.nn.modules.dynamic_module import DynamicPositionBias | |||
from zeta.nn import DynamicPositionBias |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Imports from package zeta are not grouped Warning test
self.assertIsNotNone( | ||
DenseBlock.forward.__doc__ | ||
) # Check if forward has a docstring | ||
def test_initialization(dense_block): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring Warning test
def test_forward(self): | ||
x = torch.randn(32, 10) | ||
output = self.dense_block(x) | ||
def test_forward(dense_block): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring Warning test
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() | ||
def test_docstrings(): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring Warning test
self.submodule = nn.Linear(10, 5) | ||
self.dense_block = DenseBlock(self.submodule) | ||
@pytest.fixture | ||
def dense_block(): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring Warning test
@@ -0,0 +1,19 @@ | |||
import os |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing module docstring Warning
self.assertIsNotNone( | ||
DenseBlock.forward.__doc__ | ||
) # Check if forward has a docstring | ||
def test_initialization(dense_block): |
Check notice
Code scanning / Pylintpython3 (reported by Codacy)
Redefining name 'dense_block' from outer scope (line 8) Note test
def test_forward(self): | ||
x = torch.randn(32, 10) | ||
output = self.dense_block(x) | ||
def test_forward(dense_block): |
Check notice
Code scanning / Pylintpython3 (reported by Codacy)
Redefining name 'dense_block' from outer scope (line 8) Note test
import sys | ||
|
||
|
||
def delete_pycache(directory): |
Check notice
Code scanning / Pylintpython3 (reported by Codacy)
Redefining name 'directory' from outer scope (line 17) Note
|
||
|
||
def delete_pycache(directory): | ||
for root, dirs, files in os.walk(directory): |
Check notice
Code scanning / Pylintpython3 (reported by Codacy)
Unused variable 'files' Note