This commit is contained in:
Hieu Hoang 2016-09-14 08:36:31 +02:00
parent 93eb3ca7ab
commit 5c7c044dd9
2 changed files with 2 additions and 1 deletions

View File

@ -155,7 +155,7 @@ class TensorImpl {
void set(const std::vector<Float> &values) {
size_t totSize = std::accumulate(shape().begin(), shape().end(),
1, std::multiplies<int>());
std::cerr << "totSize=" << totSize << " " << values.size() << std::endl;
std::cerr << "tensor size=" << totSize << " vector size=" << values.size() << std::endl;
assert(totSize == values.size());
thrust::copy(values.begin(), values.end(), data_.begin());
}

View File

@ -31,6 +31,7 @@ int main(int argc, char** argv) {
int numImg, imgSize;
vector<float> images = datasets::mnist::ReadImages("../examples/mnist/t10k-images-idx3-ubyte", numImg, imgSize);
vector<int> labels = datasets::mnist::ReadLabels("../examples/mnist/t10k-labels-idx1-ubyte");
cerr << "images=" << images.size() << " labels=" << labels.size() << endl;
tx.Load(images);
//ty.Load(labels);