From 8121e42ca4c90a79c8f8b1a61d424eb46f2c8c0c Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Tue, 19 May 2020 04:23:07 -0700 Subject: [PATCH] Clarify CPU/GPU infeed error messages. PiperOrigin-RevId: 312254085 Change-Id: Ic981d72bf59e41b149cf0036a272250d4ea482a3 --- tensorflow/compiler/xla/service/cpu/cpu_transfer_manager.cc | 3 ++- tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tensorflow/compiler/xla/service/cpu/cpu_transfer_manager.cc b/tensorflow/compiler/xla/service/cpu/cpu_transfer_manager.cc index fae9670051a..e21ed7ad60e 100644 --- a/tensorflow/compiler/xla/service/cpu/cpu_transfer_manager.cc +++ b/tensorflow/compiler/xla/service/cpu/cpu_transfer_manager.cc @@ -154,7 +154,8 @@ CpuTransferManager::TransferBufferToInfeedInternal(se::StreamExecutor* executor, int64 size, const void* source) { if (size > std::numeric_limits::max()) { - return InvalidArgument("Infeed shape is too large: needs %d bytes", size); + return InvalidArgument("CPU infeed of %d bytes exceeds maximum of %d bytes", + size, std::numeric_limits::max()); } if (size <= 0) { diff --git a/tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc b/tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc index 05fa798dc39..cb22b4d9042 100644 --- a/tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc +++ b/tensorflow/compiler/xla/service/gpu/gpu_transfer_manager.cc @@ -96,7 +96,8 @@ Status GpuTransferManager::EnqueueBuffersToInfeed( StatusOr GpuTransferManager::TransferBufferToInfeedInternal( se::StreamExecutor* executor, int64 size, const void* source) { if (size > std::numeric_limits::max()) { - return InvalidArgument("Infeed shape is too large: needs %d bytes", size); + return InvalidArgument("GPU infeed of %d bytes exceeds maximum of %d bytes", + size, std::numeric_limits::max()); } if (size == 0) {