Skip to content

Commit

Permalink
Merge pull request #65538 from Intel-tensorflow:remove_blockformat_tests
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 627473738
  • Loading branch information
tensorflower-gardener committed Apr 23, 2024
2 parents 2bd297a + 654e6a5 commit 2b46ab2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
10 changes: 0 additions & 10 deletions tensorflow/core/grappler/costs/graph_properties_test.cc
Expand Up @@ -268,17 +268,7 @@ TEST_F(GraphPropertiesTest, DynamicProperties) {
EXPECT_EQ(10, prop.shape().dim(0).size());
EXPECT_EQ(1, prop.shape().dim(1).size());
const auto out_props = properties.GetOutputProperties(node.name());
#ifdef INTEL_MKL
if (!NativeFormatEnabled()) {
// Intel MKL AddN OP would have two output.
// One is the real output, another one for MKL metadata
EXPECT_EQ(2, out_props.size());
} else {
EXPECT_EQ(1, out_props.size());
}
#else
EXPECT_EQ(1, out_props.size());
#endif // INTEL_MKL
string prop_str;
::tensorflow::protobuf::TextFormat::PrintToString(prop, &prop_str);
string out_prop_str;
Expand Down
32 changes: 0 additions & 32 deletions tensorflow/core/util/mkl_util_test.cc
Expand Up @@ -54,38 +54,6 @@ TEST(MklUtilTest, MklDnnTfShape) {
EXPECT_NE(b_tf_shape_nchw, b_mkldnn_tf_shape);
}

#ifndef ENABLE_ONEDNN_V3
// TODO(intel-tf): This code is not tested for oneDNN v3.x and needs to be
// removed
TEST(MklUtilTest, MklDnnBlockedFormatTest) {
// Let's create 2D tensor of shape {3, 4} with 3 being innermost dimension
// first (case 1) and then it being outermost dimension (case 2).
auto cpu_engine = engine(engine::kind::cpu, 0);

// Setting for case 1
MklDnnData<float> a(&cpu_engine);
memory::dims dim1 = {3, 4};
memory::dims strides1 = {1, 3};
a.SetUsrMem(dim1, strides1);

memory::desc a_md1 = a.GetUsrMemDesc();
EXPECT_EQ(a_md1.data.ndims, 2);
EXPECT_EQ(a_md1.data.dims[0], 3);
EXPECT_EQ(a_md1.data.dims[1], 4);

// Setting for case 2
MklDnnData<float> b(&cpu_engine);
memory::dims dim2 = {3, 4};
memory::dims strides2 = {4, 1};
b.SetUsrMem(dim2, strides2);

memory::desc b_md2 = b.GetUsrMemDesc();
EXPECT_EQ(b_md2.data.ndims, 2);
EXPECT_EQ(b_md2.data.dims[0], 3);
EXPECT_EQ(b_md2.data.dims[1], 4);
}
#endif // !ENABLE_ONEDNN_V3

TEST(MklUtilTest, LRUCacheTest) {
// The cached objects are of type int*
size_t capacity = 100;
Expand Down

0 comments on commit 2b46ab2

Please sign in to comment.