|
|
|
@ -87,7 +87,7 @@ namespace cnpy { |
|
|
|
|
assert(tmp_dims == ndims); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for(int i = 1; i < ndims; i++) { |
|
|
|
|
for(unsigned i = 1; i < ndims; i++) { |
|
|
|
|
if(shape[i] != tmp_shape[i]) { |
|
|
|
|
std::cout<<"libnpy error: npy_save attempting to append misshaped data to "<<fname<<"\n"; |
|
|
|
|
assert(shape[i] == tmp_shape[i]); |
|
|
|
@ -109,7 +109,7 @@ namespace cnpy { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned int nels = 1; |
|
|
|
|
for(int i = 0;i < ndims;i++) nels *= shape[i]; |
|
|
|
|
for(unsigned i = 0;i < ndims;i++) nels *= shape[i]; |
|
|
|
|
|
|
|
|
|
fwrite(data,sizeof(T),nels,fp); |
|
|
|
|
fclose(fp); |
|
|
|
@ -219,7 +219,7 @@ namespace cnpy { |
|
|
|
|
dict += tostring(sizeof(T)); |
|
|
|
|
dict += "', 'fortran_order': False, 'shape': ("; |
|
|
|
|
dict += tostring(shape[0]); |
|
|
|
|
for(int i = 1;i < ndims;i++) { |
|
|
|
|
for(unsigned i = 1;i < ndims;i++) { |
|
|
|
|
dict += ", "; |
|
|
|
|
dict += tostring(shape[i]); |
|
|
|
|
} |
|
|
|
|