Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
552d4aa3
Commit
552d4aa3
authored
Apr 08, 2019
by
Jared Roesch
Committed by
Tianqi Chen
Apr 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Relay][RFC][Fix] Rename RelayPrint to AsText (#2984)
parent
cffb4fba
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
include/tvm/relay/expr.h
+3
-3
python/tvm/relay/base.py
+1
-1
src/relay/ir/error.cc
+1
-1
src/relay/ir/pretty_printer.cc
+3
-3
src/relay/pass/fuse_ops.cc
+1
-1
No files found.
include/tvm/relay/expr.h
View file @
552d4aa3
...
...
@@ -562,14 +562,14 @@ inline const TTypeNode* ExprNode::type_as() const {
}
/*!
* \brief
Print node as
text format.
* \param node The node to be
print
ed.
* \brief
Render the node as a string in the Relay
text format.
* \param node The node to be
render
ed.
* \param show_meta_data Whether to print meta data section.
* \param annotate An optional callback function for attaching
* additional comment block to an expr.
* \return The text representation.
*/
std
::
string
RelayPrin
t
(
const
NodeRef
&
node
,
std
::
string
AsTex
t
(
const
NodeRef
&
node
,
bool
show_meta_data
=
true
,
runtime
::
TypedPackedFunc
<
std
::
string
(
Expr
)
>
annotate
=
nullptr
);
}
// namespace relay
...
...
python/tvm/relay/base.py
View file @
552d4aa3
...
...
@@ -78,7 +78,7 @@ class RelayNode(NodeBase):
text : str
The text format of the expression.
"""
return
_expr
.
RelayPrin
t
(
self
,
show_meta_data
,
annotate
)
return
_expr
.
AsTex
t
(
self
,
show_meta_data
,
annotate
)
def
set_span
(
self
,
span
):
_base
.
set_span
(
self
,
span
)
...
...
src/relay/ir/error.cc
View file @
552d4aa3
...
...
@@ -110,7 +110,7 @@ void ErrorReporter::RenderErrors(const Module& module, bool use_color) {
//
// The annotation callback will annotate the error messages
// contained in the map.
annotated_prog
<<
RelayPrin
t
(
func
,
false
,
[
&
err_map
](
tvm
::
relay
::
Expr
expr
)
{
annotated_prog
<<
AsTex
t
(
func
,
false
,
[
&
err_map
](
tvm
::
relay
::
Expr
expr
)
{
auto
it
=
err_map
.
find
(
expr
);
if
(
it
!=
err_map
.
end
())
{
return
it
->
second
;
...
...
src/relay/ir/pretty_printer.cc
View file @
552d4aa3
...
...
@@ -709,7 +709,7 @@ std::string PrettyPrint_(const NodeRef& node,
return
doc
.
str
();
}
std
::
string
RelayPrin
t
(
const
NodeRef
&
node
,
std
::
string
AsTex
t
(
const
NodeRef
&
node
,
bool
show_meta_data
,
runtime
::
TypedPackedFunc
<
std
::
string
(
Expr
)
>
annotate
)
{
return
PrettyPrint_
(
node
,
show_meta_data
,
annotate
,
true
);
...
...
@@ -722,10 +722,10 @@ std::string PassDebugPrint(const NodeRef& node,
return
PrettyPrint_
(
node
,
show_meta_data
,
annotate
,
gnf
);
}
TVM_REGISTER_API
(
"relay._expr.
RelayPrin
t"
)
TVM_REGISTER_API
(
"relay._expr.
AsTex
t"
)
.
set_body_typed
<
std
::
string
(
const
NodeRef
&
,
bool
,
runtime
::
TypedPackedFunc
<
std
::
string
(
Expr
)
>
)
>
(
RelayPrin
t
);
runtime
::
TypedPackedFunc
<
std
::
string
(
Expr
)
>
)
>
(
AsTex
t
);
TVM_REGISTER_API
(
"relay._ir_pass.pass_debug_print"
)
.
set_body_typed
<
std
::
string
(
const
NodeRef
&
,
...
...
src/relay/pass/fuse_ops.cc
View file @
552d4aa3
...
...
@@ -890,7 +890,7 @@ class FuseMutator : private ExprMutator {
// Debug function, dump the group assignment in text.
void
DebugDumpGroup
(
const
Expr
&
body
)
{
std
::
string
text
=
RelayPrin
t
(
body
,
false
,
[
this
](
const
Expr
&
expr
)
->
std
::
string
{
std
::
string
text
=
AsTex
t
(
body
,
false
,
[
this
](
const
Expr
&
expr
)
->
std
::
string
{
auto
it
=
gmap_
.
find
(
expr
.
get
());
if
(
it
==
gmap_
.
end
())
return
""
;
std
::
ostringstream
os
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment