Commit 5ded35b0 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

Merge branch 'develop' of https://github.com/ROCmSoftwarePlatform/AMDMIGraphX into gemm_enhancement

parents 102d2eb6 e15b8333
...@@ -22,8 +22,8 @@ struct literal : raw_data<literal> ...@@ -22,8 +22,8 @@ struct literal : raw_data<literal>
{ {
literal() {} literal() {}
template <class U, class T = deduce<U>> template <class U, class T = deduce<U>, shape::type_t ShapeType = shape::get_type<T>{}>
literal(U x) : buffer(make_shared_array<char>(sizeof(T))), m_shape(shape::get_type<T>{}) literal(U x) : buffer(make_shared_array<char>(sizeof(T))), m_shape(ShapeType)
{ {
static_assert(std::is_trivially_copyable<T>{}, "Literals can only be trivial types"); static_assert(std::is_trivially_copyable<T>{}, "Literals can only be trivial types");
*(reinterpret_cast<T*>(buffer.get())) = x; *(reinterpret_cast<T*>(buffer.get())) = x;
......
...@@ -355,7 +355,9 @@ struct onnx_parser ...@@ -355,7 +355,9 @@ struct onnx_parser
} }
if(args.size() == 2) if(args.size() == 2)
{ {
literal s = args[1]->get_literal(); auto s = args[1]->eval();
if(s.empty())
MIGRAPHX_THROW("Dynamic shape is not supported.");
s.visit([&](auto v) { copy(v, std::back_inserter(op.dims)); }); s.visit([&](auto v) { copy(v, std::back_inserter(op.dims)); });
} }
return prog.add_instruction(op, args[0]); return prog.add_instruction(op, args[0]);
......
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