MCPcopy Create free account
hub / github.com/apache/singa / ReadImage

Method ReadImage

examples/cpp/cifar10/cifar10.h:52–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50};
51
52void Cifar10::ReadImage(std::ifstream* file, int* label, char* buffer) {
53 char label_char;
54 file->read(&label_char, 1);
55 *label = static_cast<int>(label_char);
56 file->read(buffer, kImageVol);
57 return;
58}
59const std::pair<Tensor, Tensor> Cifar10::ReadFile(string file) {
60 Tensor images(Shape{kBatchSize, 3, kImageSize, kImageSize});
61 Tensor labels(Shape{kBatchSize}, kInt);

Callers

nothing calls this directly

Calls 1

readMethod · 0.80

Tested by

no test coverage detected