MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / raw_data_to_value

Function raw_data_to_value

src/serialize.cpp:33–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32template <class RawData>
33static void raw_data_to_value(value& v, const RawData& rd)
34{
35 value result;
36 result["shape"] = migraphx::to_value(rd.get_shape());
37 if(rd.get_shape().type() == shape::tuple_type)
38 result["sub"] = migraphx::to_value(rd.get_sub_objects());
39 else if(not rd.empty())
40 result["data"] = migraphx::value::binary(rd.data(), rd.get_shape().bytes());
41 v = result;
42}
43
44void migraphx_to_value(value& v, const literal& l) { raw_data_to_value(v, l); }
45void migraphx_from_value(const value& v, literal& l)

Callers 1

migraphx_to_valueFunction · 0.85

Calls 8

to_valueFunction · 0.50
binaryClass · 0.50
get_shapeMethod · 0.45
typeMethod · 0.45
get_sub_objectsMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45
bytesMethod · 0.45

Tested by

no test coverage detected