@@ -18,17 +18,6 @@ auto interpolate_registrations = RegisterNodeConversionPatterns()
18
18
auto in = args[0 ].ITensor ();
19
19
auto in_shape = util::toVec (in->getDimensions ());
20
20
21
- // remove padding that TensorRt adds automatically
22
- if (in_shape.size () >= 4 ) {
23
- // remove first dimension
24
- in_shape.erase (in_shape.begin ());
25
-
26
- auto shuffle = ctx->net ->addShuffle (*in);
27
- shuffle->setReshapeDimensions (util::toDims (in_shape));
28
- shuffle->setName ( (util::node_info (n) + " [Reshape to " + util::toStr (util::toDims (in_shape)) + " ]" ).c_str () );
29
- in = shuffle->getOutput (0 );
30
- }
31
-
32
21
// Case 1: user uses output size and not scales
33
22
if (!args[1 ].IValue ()->isNone () && args[2 ].IValue ()->isNone ()) {
34
23
auto out_size = util::toVec (util::toDims (args[1 ].unwrapToIntList ()));
@@ -45,30 +34,8 @@ auto interpolate_registrations = RegisterNodeConversionPatterns()
45
34
resize_layer->setResizeMode (nvinfer1::ResizeMode::kNEAREST );
46
35
resize_layer->setName (util::node_info (n).c_str ());
47
36
48
- // auto out_tensor = resize_layer->getOutput(0);
49
- // out_shape.erase(out_shape.begin());
50
- // auto shuffle = ctx->net->addShuffle(*out_tensor);
51
- // shuffle->setReshapeDimensions(util::toDims(out_shape));
52
- // shuffle->setName( (util::node_info(n) + " [Reshape to " + util::toStr(util::toDims(out_shape)) + "]").c_str() );
53
- // auto layer_output = ctx->AssociateValueAndTensor(n->outputs()[0], shuffle->getOutput(0));
54
- // LOG_DEBUG("Output tensor shape: " << layer_output->getDimensions());
55
-
56
- // std::cout << "PRINTING STUFF AT THE END!" << std::endl;
57
- // auto final = util::toVec(shuffle->getOutput(0)->getDimensions());
58
- // for (auto iter = final.begin(); iter != final.end(); iter++) {
59
- // std::cout << *iter << std::endl;
60
- // }
61
-
62
- // std::raise(SIGABRT);
63
-
64
37
auto layer_output = ctx->AssociateValueAndTensor (n->outputs ()[0 ], resize_layer->getOutput (0 ));
65
38
LOG_DEBUG (" Output tensor shape: " << layer_output->getDimensions ());
66
-
67
- // std::cout << "PRINTING STUFF AT THE END!" << std::endl;
68
- // auto final = util::toVec(resize_layer->getOutput(0)->getDimensions());
69
- // for (auto iter = final.begin(); iter != final.end(); iter++) {
70
- // std::cout << *iter << std::endl;
71
- // }
72
39
} else {
73
40
LOG_DEBUG (" scale factor parameter not supported yet." );
74
41
}
0 commit comments