Skip to content

Commit 33f49da

Browse files
apboselanluo-nvidia
authored andcommitted
restoring back the comment
1 parent 5b8b2ea commit 33f49da

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/runtime/execute_engine.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ void setup_input_tensors(
118118
LOG_DEBUG("Input Name: " << name << " Shape: " << dims << " isShapeInferenceIO: " << is_shape_tensor);
119119

120120
if (is_shape_tensor) {
121+
// Shape tensor inputs are casted to int64 explicitly.
122+
// Refer to
123+
// https://github.com/NVIDIA/TensorRT/blob/d2f4ef789a9a6ffdf37b55c3f81b486225f6b380/samples/common/sampleInference.cpp#L435
121124
auto input_cpu = inputs[i].clone().contiguous().cpu().to(torch::kInt64);
122125
std::vector<int64_t> inputs_cpu_vec(
123126
input_cpu.data_ptr<int64_t>(), input_cpu.data_ptr<int64_t>() + input_cpu.numel());

0 commit comments

Comments
 (0)