"configs/vscode:/vscode.git/clone" did not exist on "864ed34f565ea5c066778c3c1aa708903ec22be4"
Commit 6dfc8696 authored by Khalique's avatar Khalique
Browse files

added initial testing program with pb file

parent ca4eb13d
...@@ -52,7 +52,7 @@ struct tf_parser ...@@ -52,7 +52,7 @@ struct tf_parser
add_generic_op("Identity", op::identity{}); add_generic_op("Identity", op::identity{});
add_generic_op("Relu", op::relu{}); add_generic_op("Relu", op::relu{});
// add_binary_op("BiasAdd", op::add{}); add_binary_op("Add", op::add{});
add_mem_op("AvgPool", &tf_parser::parse_pooling); add_mem_op("AvgPool", &tf_parser::parse_pooling);
add_mem_op("BiasAdd", &tf_parser::parse_biasadd); add_mem_op("BiasAdd", &tf_parser::parse_biasadd);
...@@ -337,8 +337,13 @@ struct tf_parser ...@@ -337,8 +337,13 @@ struct tf_parser
op.lengths[1] = ksize[3]; op.lengths[1] = ksize[3];
} }
} }
auto l0 = args[0];
return prog.add_instruction(op, std::move(args)); if(l0->name() == "@param")
{
if(is_nhwc)
l0 = prog.add_instruction(op::transpose{{0, 3, 1, 2}}, l0);
}
return prog.add_instruction(op, l0);
} }
instruction_ref instruction_ref
......
...@@ -120,6 +120,15 @@ add_test(NAME test_onnx COMMAND $<TARGET_FILE:test_onnx> WORKING_DIRECTORY ${CMA ...@@ -120,6 +120,15 @@ add_test(NAME test_onnx COMMAND $<TARGET_FILE:test_onnx> WORKING_DIRECTORY ${CMA
add_dependencies(tests test_onnx) add_dependencies(tests test_onnx)
add_dependencies(check test_onnx) add_dependencies(check test_onnx)
# tf test
add_executable(test_tf tf/tf_test.cpp)
rocm_clang_tidy_check(test_tf)
target_link_libraries(test_tf migraphx_tf)
target_include_directories(test_tf PUBLIC include)
add_test(NAME test_tf COMMAND $<TARGET_FILE:test_tf> WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tf)
add_dependencies(tests test_tf)
add_dependencies(check test_tf)
function(test_header NAME HEADER) function(test_header NAME HEADER)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/header-main-include-${NAME}.cpp file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/header-main-include-${NAME}.cpp
......
:
0 Placeholder*
dtype0*
shape:

reluRelu0*
T0"
\ No newline at end of file
#include <iostream>
#include <vector>
#include <migraphx/literal.hpp>
#include <migraphx/operators.hpp>
#include <migraphx/program.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/tf.hpp>
#include "test.hpp"
TEST_CASE(relu_test)
{
migraphx::program p;
auto l0 = p.add_parameter("0", migraphx::shape{migraphx::shape::float_type, {1, 3, 16, 16}});
p.add_instruction(migraphx::op::relu{}, l0);
auto prog = migraphx::parse_tf("relu_test.pb", false);
EXPECT(p == prog);
}
int main(int argc, const char* argv[]) { test::run(argc, argv); }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment