thanks for the reply!
the following is the output of print(*torch.config.show().split("\n"), sep="\n")
PyTorch built with:
  - GCC 7.3
  - Intel(R) Math Kernel Library Version 2019.0.4 Product Build 20190411 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v0.18.1 (Git Hash 7de7e5d02bf687f971e7668963649728356e0c20)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - Build settings: BLAS=MKL, BUILD_NAMEDTENSOR=OFF, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DUSE_FBGEMM -DUSE_QNNPACK -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Wno-stringop-overflow, DISABLE_NUMA=1, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=True, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, 

when i run test_mkldnn.py, here is what is get(errors for resnet18 and resnext50_32x4d models):
======================================================================
ERROR: test_resnet18 (__main__.TestMkldnn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mkldnn.py", line 423, in test_resnet18
    self._test_imagenet_model(model)
  File "test_mkldnn.py", line 417, in _test_imagenet_model
    mkldnn_model(x.to_mkldnn()).to_dense(),
  File "/opt/dev/envs/deep_learning/lib/python3.5/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/opt/dev/envs/deep_learning/lib/python3.5/site-packages/torchvision/models/resnet.py", line 161, in forward
    x = x.view(x.size(0), -1)
RuntimeError: Currently Mkldnn tensor does not support view. Change to use reshape instead

======================================================================
ERROR: test_resnext50_32x4d (__main__.TestMkldnn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_mkldnn.py", line 427, in test_resnext50_32x4d
    model = torchvision.models.resnet.resnext50_32x4d(pretrained=False)
AttributeError: module 'torchvision.models.resnet' has no attribute 'resnext50_32x4d'

----------------------------------------------------------------------
Ran 29 tests in 2.538s

FAILED (errors=2)

i could see Pytorch is built with mkldnn, so does that mean inference on intel cpus by default will be optimized?