diff --git a/tf_adapter/ops/aicore/npu_mixed_precesion_ops.cc b/tf_adapter/ops/aicore/npu_mixed_precesion_ops.cc index 2882a6c8a33d4dc9b9c2b6663c666d3fc7d80204..8a1af5d5074cf4600dfa12df12842bcb05f274db 100644 --- a/tf_adapter/ops/aicore/npu_mixed_precesion_ops.cc +++ b/tf_adapter/ops/aicore/npu_mixed_precesion_ops.cc @@ -55,10 +55,7 @@ REGISTER_OP("NpuGetFloatStatus") .SetIsStateful(); REGISTER_OP("NpuGetFloatStatusV2") - .Input("addr: N * T") - .Output("data: T") - .Attr("N: int >= 0") - .Attr("T: {float}") + .Output("data: int32") .SetIsStateful() .SetShapeFn([](InferenceContext *c) { std::vector output_dims; diff --git a/tf_adapter/tests/st/kernels/testcase/n_p_u_get_float_statusV2_test.cc b/tf_adapter/tests/st/kernels/testcase/n_p_u_get_float_statusV2_test.cc index a81805d0567f09ef06b22e3bccd8c427f1a8a494..cc3c5de0583e0737361b811ec3c7822e2de80de5 100644 --- a/tf_adapter/tests/st/kernels/testcase/n_p_u_get_float_statusV2_test.cc +++ b/tf_adapter/tests/st/kernels/testcase/n_p_u_get_float_statusV2_test.cc @@ -28,7 +28,7 @@ FakeInputFunctor FakeInputStub(DataType dt) { } TEST(NPUGetFloatStatusV2OpTest, TestNPUGetFloatStatusV2) { - DataTypeSlice input_types({DT_FLOAT}); + DataTypeSlice input_types({}); MemoryTypeSlice input_memory_types; DataTypeSlice output_types({DT_FLOAT}); MemoryTypeSlice output_memory_types; @@ -72,15 +72,9 @@ TEST(NPUGetFloatStatusV2OpTest, TestNPUGetFloatStatusV2OShapeInference) { TF_CHECK_OK(OpRegistry::Global()->LookUp("NpuGetFloatStatusV2", ®)); OpDef op_def = reg->op_def; NodeDef def; - std::vector src_list; - src_list.emplace_back("in0", 0, DT_FLOAT); TF_CHECK_OK(NodeDefBuilder("dummy", &op_def) - .Input(src_list) - .Attr("T", DT_FLOAT) - .Attr("N", 1) .Finalize(&def)); - shape_inference::InferenceContext c(0, &def, op_def, {TShape({8})}, {}, {}, {}); - std::vector input_shapes; + shape_inference::InferenceContext c(0, &def, op_def, {TShape({})}, {}, {}, {}); TF_CHECK_OK(reg->shape_inference_fn(&c)); ASSERT_EQ("[8]", c.DebugString(c.output(0))); } diff --git a/tf_adapter/tests/ut/kernels/testcase/n_p_u_get_float_statusV2_test.cc b/tf_adapter/tests/ut/kernels/testcase/n_p_u_get_float_statusV2_test.cc index a81805d0567f09ef06b22e3bccd8c427f1a8a494..cc3c5de0583e0737361b811ec3c7822e2de80de5 100644 --- a/tf_adapter/tests/ut/kernels/testcase/n_p_u_get_float_statusV2_test.cc +++ b/tf_adapter/tests/ut/kernels/testcase/n_p_u_get_float_statusV2_test.cc @@ -28,7 +28,7 @@ FakeInputFunctor FakeInputStub(DataType dt) { } TEST(NPUGetFloatStatusV2OpTest, TestNPUGetFloatStatusV2) { - DataTypeSlice input_types({DT_FLOAT}); + DataTypeSlice input_types({}); MemoryTypeSlice input_memory_types; DataTypeSlice output_types({DT_FLOAT}); MemoryTypeSlice output_memory_types; @@ -72,15 +72,9 @@ TEST(NPUGetFloatStatusV2OpTest, TestNPUGetFloatStatusV2OShapeInference) { TF_CHECK_OK(OpRegistry::Global()->LookUp("NpuGetFloatStatusV2", ®)); OpDef op_def = reg->op_def; NodeDef def; - std::vector src_list; - src_list.emplace_back("in0", 0, DT_FLOAT); TF_CHECK_OK(NodeDefBuilder("dummy", &op_def) - .Input(src_list) - .Attr("T", DT_FLOAT) - .Attr("N", 1) .Finalize(&def)); - shape_inference::InferenceContext c(0, &def, op_def, {TShape({8})}, {}, {}, {}); - std::vector input_shapes; + shape_inference::InferenceContext c(0, &def, op_def, {TShape({})}, {}, {}, {}); TF_CHECK_OK(reg->shape_inference_fn(&c)); ASSERT_EQ("[8]", c.DebugString(c.output(0))); }