You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Being able to dump any interesting data structures is very useful for interactive debugging and print debugging.
Currently, many of interesting data structures (e.g. glow::Value) have dump methods. Some others, e.g. glow::Node have getDebugDesc() method, but no dump method. And many interesting data structures don't have any method to dump their content, e.g. glow::Type.
Ideally, it would be nice to have the same uniform way to dump any data structure. LLVM usually uses dump for it.
It is also very useful to be able to get a string representation of the dumped content of any data structure as it allows for including it into a bigger composite output consisting of many different parts.
So, in short it would be nice to have e.g. the following methods for all interesting data structures in Glow:
dump(llvm::raw_ostream &os)
dump() which just calls dump(llvm::raw_ostream &os) with a default output stream as a parameter
std::string toString(), which dumps into string
The text was updated successfully, but these errors were encountered:
@opti-mix
I've inserted those dump functions to glow::Node and glow::Type at #2969.
Could you list some other useful data structures that require dump functions?
Could you list some other useful data structures that require dump functions?
Add any missing helper methods (e.g. to produce a string or operator <<) for glow::Module, glow::Fucnction, glow::IRFunction, glow::Value, glow::Instruction and glow::Tensor. These are those most widely used data types in Glow.
In general it would be nice to also be able to dump/print all major runtime data-structures, e.g. ExecutionContext and the like. But all this probably would need to be implemented manually as C++ does not allow for introspection of types defined in the program (at least not without using a lot of macros/templates magic).
[Dump information] add dump function for Glow data structure
Summary:
add dump(llvm::raw_ostream &os), dump() and std::string toString() to
data structure glow::Node, glow::Type, glow::Module, glow::Function,
glow::IRFunction, glow::Value and glow::Tensor.
add overloading << operator to those data structures.
Test:
add test under BackendTest, GraphTest, IROptTest and TensorsTest to
verify the dump functions.
Fixes:
This PR fixespytorch#2831
Being able to dump any interesting data structures is very useful for interactive debugging and print debugging.
Currently, many of interesting data structures (e.g.
glow::Value
) havedump
methods. Some others, e.g.glow::Node
havegetDebugDesc()
method, but nodump
method. And many interesting data structures don't have any method to dump their content, e.g.glow::Type
.Ideally, it would be nice to have the same uniform way to dump any data structure. LLVM usually uses
dump
for it.It is also very useful to be able to get a string representation of the dumped content of any data structure as it allows for including it into a bigger composite output consisting of many different parts.
So, in short it would be nice to have e.g. the following methods for all interesting data structures in Glow:
dump(llvm::raw_ostream &os)
dump()
which just callsdump(llvm::raw_ostream &os)
with a default output stream as a parameterstd::string toString()
, which dumps into stringThe text was updated successfully, but these errors were encountered: