File tree Expand file tree Collapse file tree 3 files changed +1
-12
lines changed
Expand file tree Collapse file tree 3 files changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ src/gcaa/.ipynb_checkpoints/
1414* /.ipynb_checkpoints /*
1515* /.idea /*
1616* /.pytest_cache /*
17- /src /gcaa /torchlogs /*
1817* .coverage
1918* coverage.xml
2019report
Original file line number Diff line number Diff line change 11from collections import defaultdict
22
33import numpy as np
4- import torch
5-
64
75class PrettyDict (dict ):
86 def __repr__ (self ):
@@ -15,22 +13,15 @@ def dict_factory():
1513
1614def check_nan (data ):
1715 """
18- >>> check_nan(torch.Tensor([1, 2, 3]))
19- >>> check_nan(np.array([1, 2, 3]))
2016 >>> check_nan(None)
21- >>> check_nan(torch.Tensor([1, float('nan'), 3]))
22- Traceback (most recent call last):
23- ...
24- RuntimeError: NaN detected in: tensor([1., nan, 3.])
17+ >>> check_nan(np.array([1, 2, 3]))
2518 >>> check_nan(np.array([1, float('nan'), 3]))
2619 Traceback (most recent call last):
2720 ...
2821 RuntimeError: NaN detected in: [ 1. nan 3.]
2922 """
3023 if data is None :
3124 return
32- if isinstance (data , torch .Tensor ) and not torch .isnan (data ).any ():
33- return
3425 if isinstance (data , np .ndarray ) and not np .isnan (data ).any ():
3526 return
3627 raise RuntimeError (f"NaN detected in: { data } " )
Original file line number Diff line number Diff line change 22
33conda create -n test python=3.12 pip -y
44conda activate test
5- pip install torch --index-url https://download.pytorch.org/whl/cpu
65pip install gcaa
76python -c " from gcaa import GCAA; GCAA().run()"
87echo " Installation from Pypi ran a test successfully"
You can’t perform that action at this time.
0 commit comments