Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
e7874833
"aten/git@developer.sourcefind.cn:OpenDAS/torch-cluster.git" did not exist on "932b96e281525ce96855c3615215fe54cb8cac1b"
Commit
e7874833
authored
Nov 26, 2018
by
wsttiger
Browse files
fixes
parent
270a1cfb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
23 deletions
+15
-23
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+14
-14
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+1
-9
No files found.
src/include/migraphx/operators.hpp
View file @
e7874833
...
@@ -285,12 +285,12 @@ struct transpose
...
@@ -285,12 +285,12 @@ struct transpose
int
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
int
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
};
// The contiguous operator takes a non-standard input tensor and returns
//
/
The contiguous operator takes a non-standard input tensor and returns
// the same tensor but in standard form. For example, if input tensor A which has lens = (4,5)
//
/
the same tensor but in standard form. For example, if input tensor A which has lens = (4,5)
// is first transposed, i.e. lens = (5,4), this tensor's data layout remained the same
//
/
is first transposed, i.e. lens = (5,4), this tensor's data layout remained the same
// during the transpose operation; only it's shape lengths and strides were changed.
//
/
during the transpose operation; only it's shape lengths and strides were changed.
// This leaves the tensor in a non-standard form. The contiguous operator copies the
//
/
This leaves the tensor in a non-standard form. The contiguous operator copies the
// underlying data such that resulting tensor is returned to a standard form.
//
/
underlying data such that resulting tensor is returned to a standard form.
struct
contiguous
struct
contiguous
{
{
std
::
string
name
()
const
{
return
"contiguous"
;
}
std
::
string
name
()
const
{
return
"contiguous"
;
}
...
@@ -716,14 +716,14 @@ struct flatten
...
@@ -716,14 +716,14 @@ struct flatten
int
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
int
output_alias
(
const
std
::
vector
<
shape
>&
)
const
{
return
0
;
}
};
};
// The broadcast operator performs the numpy-style broadcasting of an axis of a given tensor. This
//
/
The broadcast operator performs the numpy-style broadcasting of an axis of a given tensor. This
// is achieved primarily by setting the stride of the broadcasted axis to zero. Linear indicies are
//
/
is achieved primarily by setting the stride of the broadcasted axis to zero. Linear indicies are
// computed from multi-indicies by computing the inner product on the multi-index with the strides.
//
/
computed from multi-indicies by computing the inner product on the multi-index with the strides.
// For example, if we have a tensor A(2,3) it has lengths of (2,3) and strides of (3,1). If we want
//
/
For example, if we have a tensor A(2,3) it has lengths of (2,3) and strides of (3,1). If we want
// to compute the linear offset that corresponds to the element on the 2nd row (i = 1) and 3rd
//
/
to compute the linear offset that corresponds to the element on the 2nd row (i = 1) and 3rd
// column (j = 2), we compute the following inner product (1,2) dot (3, 1) = 1*3 + 2*1 = 5. It is
//
/
column (j = 2), we compute the following inner product (1,2) dot (3, 1) = 1*3 + 2*1 = 5. It is
// obvious from there that we can negate the effects of a given axis by setting the stride of that
//
/
obvious from there that we can negate the effects of a given axis by setting the stride of that
// axis to zero.
//
/
axis to zero.
struct
broadcast
struct
broadcast
{
{
uint64_t
axis
=
0
;
uint64_t
axis
=
0
;
...
...
src/onnx/onnx.cpp
View file @
e7874833
...
@@ -215,7 +215,7 @@ struct onnx_parser
...
@@ -215,7 +215,7 @@ struct onnx_parser
MIGRAPH_THROW
(
"auto_pad and padding cannot be specified simultaneously"
);
MIGRAPH_THROW
(
"auto_pad and padding cannot be specified simultaneously"
);
}
}
if
(
s
.
find
(
"SAME"
)
>
=
0
)
if
(
s
.
find
(
"SAME"
)
!
=
std
::
string
::
npos
)
{
{
op
.
padding_mode
=
op
::
convolution
::
same
;
op
.
padding_mode
=
op
::
convolution
::
same
;
}
}
...
@@ -481,14 +481,6 @@ struct onnx_parser
...
@@ -481,14 +481,6 @@ struct onnx_parser
onnx
::
ModelProto
model
;
onnx
::
ModelProto
model
;
if
(
model
.
ParseFromIstream
(
&
is
))
if
(
model
.
ParseFromIstream
(
&
is
))
{
{
auto
str_toupper
=
[](
std
::
string
s
)
{
std
::
transform
(
s
.
begin
(),
s
.
end
(),
s
.
begin
(),
[](
unsigned
char
c
)
{
return
std
::
toupper
(
c
);
});
return
s
;
};
auto
producer_name
=
str_toupper
(
model
.
producer_name
());
std
::
cout
<<
producer_name
<<
std
::
endl
;
if
(
model
.
has_graph
())
if
(
model
.
has_graph
())
{
{
this
->
parse_graph
(
model
.
graph
());
this
->
parse_graph
(
model
.
graph
());
...
...
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