Commit cc49bfd4 authored by Paul's avatar Paul
Browse files

Fix compile error

parent aa1844fc
...@@ -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;
......
...@@ -354,7 +354,7 @@ struct onnx_parser ...@@ -354,7 +354,7 @@ struct onnx_parser
} }
if(args.size() == 2) if(args.size() == 2)
{ {
literal s = args[1]->eval(); auto s = args[1]->eval();
if(s.empty()) if(s.empty())
MIGRAPHX_THROW("Dynamic shape is not supported."); 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)); });
......
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