Update 'import-onednn.sh' test case per code review

This commit is contained in:
Abolfazl Shahbazi 2020-07-08 18:01:34 -07:00
parent 6879366d63
commit 6e98b7f78d

View File

@ -15,12 +15,16 @@
# limitations under the License. # limitations under the License.
# ============================================================================ # ============================================================================
{ # try python -c 'from tensorflow.python import _pywrap_util_port; print(_pywrap_util_port.IsMklEnabled())'
echo `python -c 'from tensorflow.python import _pywrap_util_port; print(_pywrap_util_port.IsMklEnabled())'` new_mkl_enabled=$?
python -c 'from tensorflow.python import pywrap_tensorflow; print(pywrap_tensorflow.IsMklEnabled())'
old_mkl_enabled=$?
if [[ $new_mkl_enabled -eq 0 ]]; then
echo "PASS: MKL is enabled" echo "PASS: MKL is enabled"
} || { # catch elif [[ $old_mkl_enabled -eq 0]]; then
echo `python -c 'from tensorflow.python import pywrap_tensorflow; print(pywrap_tensorflow.IsMklEnabled())'`
echo "PASS: Old MKL is detected" echo "PASS: Old MKL is detected"
} || { # finally else
die "FAIL: MKL is not enabled" die "FAIL: MKL is not enabled"
} fi