Skip to content

Commit 15f9205

Browse files
committed
refactor: Add dataset scaling
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent e633dc1 commit 15f9205

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/accuracy/datasets/cifar10.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ std::pair<torch::Tensor, torch::Tensor> read_batch(const std::string& path) {
5151
labels.push_back(label);
5252
auto image_tensor =
5353
torch::from_blob(image.data(), {kImageChannels, kImageDim, kImageDim}, torch::TensorOptions().dtype(torch::kU8))
54-
.to(torch::kF32);
54+
.to(torch::kF32).div(255);
5555
images.push_back(image_tensor);
5656
}
5757

0 commit comments

Comments
 (0)