Compilation warnings removed from tensor_format.h

Removed compilation warnings
This commit is contained in:
Pariksheet Pinjari 2019-03-19 17:05:03 +05:30 committed by GitHub
parent 83c6c627e5
commit 89ea6622a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,6 +120,9 @@ inline int GetTensorSpatialDims(int num_dims, TensorFormat format) {
// Note: the VECT_W is not counted as an independent spatial dim here,
// since it just a component of the width dimension.
return num_dims - 3; // Exclude N,C,VectDim.
default:
LOG(FATAL) << "Unknown format " << format;
return -1; // Avoid compiler warning about missing return value
}
}
@ -144,6 +147,9 @@ inline int GetTensorDimsFromSpatialDims(int num_spatial_dims,
case FORMAT_NCHW_VECT_C:
case FORMAT_NHWC_VECT_W:
return num_spatial_dims + 3; // Include N,C,VectDim.
default:
LOG(FATAL) << "Unknown format " << format;
return -1; // Avoid compiler warning about missing return value
}
}