void flip_dims(cuv::tensor<float,cuv::dev_memory_space>& dst, const cuv::tensor<float,cuv::dev_memory_space>& src, const cuv::extent_gen<D>& pattern) { assert(D == dst.ndim()); bool p[D]; for (int i = 0; i < D; ++i) { p[i] = pattern.ranges_[i].finish(); } flip_dims2(dst,src, p); }
void save(Archive& ar, const cuv::tensor<V,MS, ML>& t, const unsigned int version){ ar << t.info().host_shape << t.info().host_stride; ar << t.mem(); if(t.ndim()>0 && t.mem()){ long int i = (long int)t.ptr() - (long int)t.mem()->ptr(); ar << i; } }