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
ea063888
Unverified
Commit
ea063888
authored
Apr 08, 2020
by
Zhi
Committed by
GitHub
Apr 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUGFIX][IR] Fix String SEqual (#5275)
* fix String SEqual * retrigger ci
parent
d430d528
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/node/container.cc
+2
-2
tests/python/relay/test_ir_structural_equal_hash.py
+3
-3
No files found.
src/node/container.cc
View file @
ea063888
...
@@ -43,8 +43,8 @@ struct StringObjTrait {
...
@@ -43,8 +43,8 @@ struct StringObjTrait {
SEqualReducer
equal
)
{
SEqualReducer
equal
)
{
if
(
lhs
==
rhs
)
return
true
;
if
(
lhs
==
rhs
)
return
true
;
if
(
lhs
->
size
!=
rhs
->
size
)
return
false
;
if
(
lhs
->
size
!=
rhs
->
size
)
return
false
;
if
(
lhs
->
data
!
=
rhs
->
data
)
return
true
;
if
(
lhs
->
data
=
=
rhs
->
data
)
return
true
;
return
std
::
memcmp
(
lhs
->
data
,
rhs
->
data
,
lhs
->
size
)
!
=
0
;
return
std
::
memcmp
(
lhs
->
data
,
rhs
->
data
,
lhs
->
size
)
=
=
0
;
}
}
};
};
...
...
tests/python/relay/test_ir_structural_equal_hash.py
View file @
ea063888
...
@@ -356,7 +356,7 @@ def test_function_attr():
...
@@ -356,7 +356,7 @@ def test_function_attr():
p00
=
relay
.
subtract
(
z00
,
w01
)
p00
=
relay
.
subtract
(
z00
,
w01
)
q00
=
relay
.
multiply
(
p00
,
w02
)
q00
=
relay
.
multiply
(
p00
,
w02
)
func0
=
relay
.
Function
([
x0
,
w00
,
w01
,
w02
],
q00
)
func0
=
relay
.
Function
([
x0
,
w00
,
w01
,
w02
],
q00
)
func0
=
func0
.
with_attr
(
"FuncName"
,
tvm
.
tir
.
StringImm
(
"a"
))
func0
=
func0
.
with_attr
(
"FuncName"
,
tvm
.
runtime
.
container
.
String
(
"a"
))
x1
=
relay
.
var
(
'x1'
,
shape
=
(
10
,
10
))
x1
=
relay
.
var
(
'x1'
,
shape
=
(
10
,
10
))
w10
=
relay
.
var
(
'w10'
,
shape
=
(
10
,
10
))
w10
=
relay
.
var
(
'w10'
,
shape
=
(
10
,
10
))
...
@@ -366,7 +366,7 @@ def test_function_attr():
...
@@ -366,7 +366,7 @@ def test_function_attr():
p10
=
relay
.
subtract
(
z10
,
w11
)
p10
=
relay
.
subtract
(
z10
,
w11
)
q10
=
relay
.
multiply
(
p10
,
w12
)
q10
=
relay
.
multiply
(
p10
,
w12
)
func1
=
relay
.
Function
([
x1
,
w10
,
w11
,
w12
],
q10
)
func1
=
relay
.
Function
([
x1
,
w10
,
w11
,
w12
],
q10
)
func1
=
func1
.
with_attr
(
"FuncName"
,
tvm
.
tir
.
StringImm
(
"b"
))
func1
=
func1
.
with_attr
(
"FuncName"
,
tvm
.
runtime
.
container
.
String
(
"b"
))
assert
not
consistent_equal
(
func0
,
func1
)
assert
not
consistent_equal
(
func0
,
func1
)
...
@@ -698,7 +698,7 @@ def test_fn_attribute():
...
@@ -698,7 +698,7 @@ def test_fn_attribute():
d
=
relay
.
var
(
'd'
,
shape
=
(
10
,
10
))
d
=
relay
.
var
(
'd'
,
shape
=
(
10
,
10
))
add_1
=
relay
.
add
(
c
,
d
)
add_1
=
relay
.
add
(
c
,
d
)
add_1_fn
=
relay
.
Function
([
c
,
d
],
add_1
)
add_1_fn
=
relay
.
Function
([
c
,
d
],
add_1
)
add_1_fn
=
add_1_fn
.
with_attr
(
"TestAttribute"
,
tvm
.
tir
.
StringImm
(
"test"
))
add_1_fn
=
add_1_fn
.
with_attr
(
"TestAttribute"
,
tvm
.
runtime
.
container
.
String
(
"test"
))
add_1_fn
=
run_opt_pass
(
add_1_fn
,
relay
.
transform
.
InferType
())
add_1_fn
=
run_opt_pass
(
add_1_fn
,
relay
.
transform
.
InferType
())
assert
not
consistent_equal
(
add_1_fn
,
add_fn
)
assert
not
consistent_equal
(
add_1_fn
,
add_fn
)
...
...
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