File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,11 @@ typedef struct {
2323// corresponds to BSP_TENSOR_DENSE
2424typedef struct {
2525 int rank ;
26+ // pointers_to, while it will only ever point to one bsp_array_t, must be kept
27+ // as a pointer (rather than a struct) because there are cases where it MUST
28+ // be null.
2629 bsp_array_t * pointers_to ;
30+ // indices is supposed to be an array of bsp_array_t's.
2731 bsp_array_t * indices ;
2832 bsp_level_t * child ;
2933} bsp_sparse_t ;
Original file line number Diff line number Diff line change @@ -57,3 +57,35 @@ tensortest(
5757 joinpath (test_files, " input4.bsp.h5" ),
5858 joinpath (test_files, " output4.bsp.h5" )
5959)
60+
61+ tensortest (
62+ Tensor (
63+ Dense (SparseList {Int32} (Element {0.0,Float64,Int32} ())),
64+ [
65+ 0 1 0 3 ;
66+ 1 0 0 4 ;
67+ ]
68+ ),
69+ joinpath (test_files, " inputcsr.bsp.h5" ),
70+ joinpath (test_files, " outputcsr.bsp.h5" )
71+ )
72+ tensortest (
73+ Tensor (
74+ Dense (SparseList {Int32} (Element {0.0,Float64,Int32} ())),
75+ fsprand (10 , 10 , 0.1 )
76+ ),
77+ joinpath (test_files, " inputcsr2.bsp.h5" ),
78+ joinpath (test_files, " outputcsr2.bsp.h5" )
79+ )
80+
81+ tensortest (
82+ Tensor (
83+ Dense (Dense (Element (0.0 ))),
84+ [
85+ 1 1 2 3 ;
86+ 6 1 5 4 ;
87+ ]
88+ ),
89+ joinpath (test_files, " inputdense.bsp.h5" ),
90+ joinpath (test_files, " outputdense.bsp.h5" )
91+ )
You can’t perform that action at this time.
0 commit comments