Skip to content

Commit 1326967

Browse files
committed
Return status correctly.
1 parent ff46131 commit 1326967

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

tensorflow/core/kernels/mkl/mkl_kernel_util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class MklTestingUtil {
5555
// and max values to be in float type, min_tensor and max_tensor should have
5656
// their dtype set to DT_FLOAT.
5757
template <typename T>
58-
static void GetQuantizationTensors(const Tensor& input, Tensor* output,
58+
static Status GetQuantizationTensors(const Tensor& input, Tensor* output,
5959
DataType out_type, const string mode,
6060
Tensor* min_tensor, Tensor* max_tensor) {
6161
if (min_tensor->dtype() != DT_FLOAT || max_tensor->dtype() != DT_FLOAT) {

tensorflow/core/kernels/mkl/onednn_fused_matmul_ops_test.cc

+6-4
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,10 @@ class FusedMatMulOpsTest : public OpsTestBase {
346346
Tensor x_qtensor(qinput_dtype, x.shape());
347347
Tensor x_min_tensor(DT_FLOAT, TensorShape({}));
348348
Tensor x_max_tensor(DT_FLOAT, TensorShape({}));
349-
MklTestingUtil::GetQuantizationTensors<T>(x, &x_qtensor, qinput_dtype,
350-
input_quant_mode, &x_min_tensor,
351-
&x_max_tensor);
349+
auto status = MklTestingUtil::GetQuantizationTensors<T>(
350+
x, &x_qtensor, qinput_dtype, input_quant_mode, &x_min_tensor,
351+
&x_max_tensor);
352+
ASSERT_TRUE(status.ok());
352353
Tensor y_qtensor(DT_QINT8, y.shape());
353354
const int num_channels = transpose_y ? y.dim_size(0) : y.dim_size(1);
354355
TensorShape minmax_shape =
@@ -364,8 +365,9 @@ class FusedMatMulOpsTest : public OpsTestBase {
364365
&y_max_tensor);
365366
}
366367
} else {
367-
MklTestingUtil::GetQuantizationTensors<T>(
368+
auto status = MklTestingUtil::GetQuantizationTensors<T>(
368369
y, &y_qtensor, DT_QINT8, "SCALED", &y_min_tensor, &y_max_tensor);
370+
ASSERT_TRUE(status.ok());
369371
}
370372

371373
Scope root = tensorflow::Scope::NewRootScope();

0 commit comments

Comments
 (0)