| 951 | // Common utility functions used by OneDNN unit tests |
| 952 | |
| 953 | inline Tensor GetMklMetaTensor() { |
| 954 | MklDnnShape non_mkl_shape; |
| 955 | non_mkl_shape.SetMklTensor(false); |
| 956 | |
| 957 | auto size = static_cast<int64>(non_mkl_shape.GetSerializeBufferSize()); |
| 958 | Tensor tensor(DT_UINT8, {size}); |
| 959 | |
| 960 | non_mkl_shape.SerializeMklDnnShape(tensor.flat<uint8>().data(), |
| 961 | size * sizeof(uint8)); |
| 962 | return tensor; |
| 963 | } |
| 964 | |
| 965 | // ------------------------------------------------------------------- |
| 966 |