summaryrefslogtreecommitdiff
path: root/aten/src/data/test/basic.cc
blob: a52b817fddbaad4edb9785dfded51c21ea9489cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "Dataset.h"
#include "DatasetIterator.h"
#include "TensorDataset.h"
#include <iostream>

using namespace at;

int main()
{
   std::cout << "hello\n";

   Tensor tensor = CPU(kDouble).rand({256,32});

   TensorDataset dataset(tensor);
   DatasetIterator datasetiterator(dataset);
   uint64_t cnt = 0;
   for(auto& sample : datasetiterator) {
      std::cout << "got sample " << cnt << std:endl;
      cnt++;
   }
   return 0;
}