MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / Classifier

Method Classifier

lesson5-TrainingVGG/Classification.cpp:4–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3
4Classifier::Classifier(int gpu_id)
5{
6 if (gpu_id >= 0) {
7 device = torch::Device(torch::kCUDA, gpu_id);
8 }
9 else {
10 device = torch::Device(torch::kCPU);
11 }
12}
13
14void Classifier::Initialize(int _num_classes, std::string _pretrained_path){
15 std::vector<int> cfg_d = {64, 64, -1, 128, 128, -1, 256, 256, 256, -1, 512, 512, 512, -1, 512, 512, 512, -1};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected