File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed
Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 44 tensor ,
55 Tensor ,
66)
7+ from mygrad ._dtype_mirrors import *
78from mygrad ._utils .graph_tracking import no_autodiff
89from mygrad ._utils .lock_management import (
910 mem_guard_active ,
Original file line number Diff line number Diff line change 1+ import numpy
2+
3+ __all__ = [
4+ "bool8" ,
5+ "int8" ,
6+ "int16" ,
7+ "int32" ,
8+ "int64" ,
9+ "uint8" ,
10+ "uint16" ,
11+ "uint32" ,
12+ "uint64" ,
13+ "intp" ,
14+ "uintp" ,
15+ "float16" ,
16+ "float32" ,
17+ "float64" ,
18+ "half" ,
19+ "single" ,
20+ "double" ,
21+ "longdouble" ,
22+ ]
23+
24+ bool8 = numpy .bool8
25+ int8 = numpy .int8
26+ int16 = numpy .int16
27+ int32 = numpy .int32
28+ int64 = numpy .int64
29+ uint8 = numpy .uint8
30+ uint16 = numpy .uint16
31+ uint32 = numpy .uint32
32+ uint64 = numpy .uint64
33+ intp = numpy .intp
34+ uintp = numpy .uintp
35+ float16 = numpy .float16
36+ float32 = numpy .float32
37+ float64 = numpy .float64
38+ half = numpy .half
39+ single = numpy .single
40+ double = numpy .double
41+ longdouble = numpy .longdouble
Original file line number Diff line number Diff line change 1+ import pytest
2+
3+ import mygrad as mg
4+ from mygrad ._dtype_mirrors import __all__ as all_mirrored_dtyped
5+
6+
7+ @pytest .mark .parametrize ("dtype_str" , all_mirrored_dtyped )
8+ def test_mirrored_dtype_is_valid (dtype_str ):
9+ mg .tensor (1 , dtype = getattr (mg , dtype_str ))
You can’t perform that action at this time.
0 commit comments