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
b0481c82
Commit
b0481c82
authored
Jul 19, 2019
by
Yizhi Liu
Committed by
Tianqi Chen
Jul 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add printer for Layout/BijectiveLayout (#3582)
parent
bfafa908
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
python/tvm/tensor.py
+0
-6
src/lang/data_layout.cc
+11
-0
No files found.
python/tvm/tensor.py
View file @
b0481c82
...
...
@@ -225,12 +225,6 @@ class Layout(NodeBase):
--------
layout : Declare a layout
"""
def
__str__
(
self
):
return
self
.
name
def
__repr__
(
self
):
return
"Layout("
+
self
.
name
+
")"
def
__len__
(
self
):
return
_api_internal
.
_LayoutNdim
(
self
)
...
...
src/lang/data_layout.cc
View file @
b0481c82
...
...
@@ -195,6 +195,11 @@ int32_t Layout::FactorOf(const LayoutAxis& axis) const {
return
-
1
;
}
TVM_STATIC_IR_FUNCTOR
(
IRPrinter
,
vtable
)
.
set_dispatch
<
LayoutNode
>
([](
const
LayoutNode
*
l
,
IRPrinter
*
p
)
{
p
->
stream
<<
"Layout("
<<
l
->
name
<<
")"
;
});
inline
bool
GetStoreRule
(
Array
<
Expr
>*
rule
,
const
Layout
&
src_layout
,
const
Layout
&
dst_layout
)
{
...
...
@@ -346,4 +351,10 @@ BijectiveLayout BijectiveLayoutNode::make(const Layout& src_layout,
return
BijectiveLayout
(
n
);
}
TVM_STATIC_IR_FUNCTOR
(
IRPrinter
,
vtable
)
.
set_dispatch
<
BijectiveLayoutNode
>
([](
const
BijectiveLayoutNode
*
b
,
IRPrinter
*
p
)
{
p
->
stream
<<
"BijectiveLayout("
<<
b
->
src_layout
.
name
()
<<
"->"
<<
b
->
dst_layout
.
name
()
<<
")"
;
});
}
// namespace tvm
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