-
Notifications
You must be signed in to change notification settings - Fork 862
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #37 general datatype for scalar
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from tensorboardX import x2num | ||
import numpy as np | ||
def test_scalar(): | ||
res = x2num.makenp(1.1) | ||
assert isinstance(res, np.ndarray) and res.shape == (1,) | ||
res = x2num.makenp(1000000000000000000000) | ||
assert isinstance(res, np.ndarray) and res.shape == (1,) | ||
res = x2num.makenp(np.float16(1.00000087)) | ||
assert isinstance(res, np.ndarray) and res.shape == (1,) | ||
res = x2num.makenp(np.float128(1.00008+9)) | ||
assert isinstance(res, np.ndarray) and res.shape == (1,) | ||
res = x2num.makenp(np.int64(100000000000)) | ||
assert isinstance(res, np.ndarray) and res.shape == (1,) | ||
|
||
|
||
def test_make_grid(): | ||
pass |