|
|
|
@@ -300,7 +300,18 @@ py::tuple GPUSession::RunOp(const OpRunInfo &op_run_info, const GraphInfo &graph |
|
|
|
} |
|
|
|
// Fetch outputs |
|
|
|
VectorRef outputs; |
|
|
|
UpdateOutputs(kernel_graph, &outputs, input_tensors); |
|
|
|
if (op_run_info.value != nullptr) { |
|
|
|
std::vector<tensor::TensorPtr> pre_output_tensors; |
|
|
|
TensorValueToTensor(op_run_info.value, &pre_output_tensors); |
|
|
|
for (auto &pre_output : pre_output_tensors) { |
|
|
|
tensor::TensorPtr tensor = std::make_shared<tensor::Tensor>(pre_output->data_type(), pre_output->shape()); |
|
|
|
tensor->set_device_address(pre_output->device_address()); |
|
|
|
tensor->set_dirty(false); |
|
|
|
outputs.emplace_back(tensor); |
|
|
|
} |
|
|
|
} else { |
|
|
|
UpdateOutputs(kernel_graph, &outputs, input_tensors); |
|
|
|
} |
|
|
|
// Trans output to tuple |
|
|
|
auto output_tensors = TransformBaseRefListToTuple(outputs); |
|
|
|
if (!utils::isa<PyObjectRef>(output_tensors) || |
|
|
|
|