diff --git a/onnxruntime/core/framework/session_state_utils.cc b/onnxruntime/core/framework/session_state_utils.cc index bf35b82beb..3791919438 100644 --- a/onnxruntime/core/framework/session_state_utils.cc +++ b/onnxruntime/core/framework/session_state_utils.cc @@ -44,7 +44,7 @@ static common::Status AllocateBufferUsingDeviceAllocatorFromShapeAndType(const T if (shape_size > 0) { SafeInt mem_size = 0; - if (!alloc->CalcMemSizeForArray(SafeInt(shape_size), type->Size(), &mem_size)) { + if (!IAllocator::CalcMemSizeForArray(SafeInt(shape_size), type->Size(), &mem_size)) { return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, "Failed memory size calculation"); } diff --git a/onnxruntime/core/framework/tensor.cc b/onnxruntime/core/framework/tensor.cc index 01ca218ba8..81c9db9163 100644 --- a/onnxruntime/core/framework/tensor.cc +++ b/onnxruntime/core/framework/tensor.cc @@ -29,7 +29,7 @@ Tensor::Tensor(MLDataType p_type, const TensorShape& shape, std::shared_ptr 0) { SafeInt len = 0; - if (!allocator->CalcMemSizeForArray(SafeInt(shape_size), p_type->Size(), &len)) + if (!IAllocator::CalcMemSizeForArray(SafeInt(shape_size), p_type->Size(), &len)) ORT_THROW("tensor failed memory size calculation"); p_data = allocator->Alloc(len);