move variable declaration to avoid unused variable error (#5603)

Co-authored-by: Juliana <jufranc@microsoft.com>
This commit is contained in:
Juliana Franco 2020-10-28 16:23:58 +00:00 committed by GitHub
parent 0dbf3e8893
commit 27c6d1eeb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,7 +139,6 @@ void DumpTensor(
const SessionState& session_state) {
// check tensor is on CPU before dumping it
auto& tensor_location = tensor.Location();
const auto data_type = tensor.DataType();
if (tensor_location.device.Type() == OrtDevice::CPU ||
tensor_location.mem_type == OrtMemTypeCPUInput ||
tensor_location.mem_type == OrtMemTypeCPUOutput) {
@ -148,6 +147,7 @@ void DumpTensor(
std::cout << tensor_location << "\n";
#ifdef USE_CUDA
const auto data_type = tensor.DataType();
// Dumping GPU only when cuda is enabled.
if (tensor_location.device.Type() == OrtDevice::GPU) {
const auto& execution_providers = session_state.GetExecutionProviders();