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
94e3a2e4
Commit
94e3a2e4
authored
Feb 12, 2022
by
Shucai Xiao
Browse files
change size_t to int
parent
26bd92d8
Changes
256
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
27 additions
and
27 deletions
+27
-27
src/inline_module.cpp
src/inline_module.cpp
+1
-1
src/json.cpp
src/json.cpp
+1
-1
src/load_save.cpp
src/load_save.cpp
+1
-1
src/module.cpp
src/module.cpp
+1
-1
src/msgpack.cpp
src/msgpack.cpp
+3
-3
src/normalize_attributes.cpp
src/normalize_attributes.cpp
+2
-2
src/onnx/checks.cpp
src/onnx/checks.cpp
+1
-1
src/onnx/conv.cpp
src/onnx/conv.cpp
+1
-1
src/onnx/include/migraphx/onnx/checks.hpp
src/onnx/include/migraphx/onnx/checks.hpp
+1
-1
src/onnx/include/migraphx/onnx/conv.hpp
src/onnx/include/migraphx/onnx/conv.hpp
+1
-1
src/onnx/parse_constant_fill.cpp
src/onnx/parse_constant_fill.cpp
+2
-2
src/onnx/parse_constant_of_shape.cpp
src/onnx/parse_constant_of_shape.cpp
+1
-1
src/onnx/parse_deconvolution.cpp
src/onnx/parse_deconvolution.cpp
+2
-2
src/onnx/parse_gather_elements.cpp
src/onnx/parse_gather_elements.cpp
+1
-1
src/onnx/parse_gru.cpp
src/onnx/parse_gru.cpp
+2
-2
src/onnx/parse_if.cpp
src/onnx/parse_if.cpp
+1
-1
src/onnx/parse_loop.cpp
src/onnx/parse_loop.cpp
+1
-1
src/onnx/parse_lstm.cpp
src/onnx/parse_lstm.cpp
+2
-2
src/onnx/parse_prefix_scan.cpp
src/onnx/parse_prefix_scan.cpp
+1
-1
src/onnx/parse_range.cpp
src/onnx/parse_range.cpp
+1
-1
No files found.
src/inline_module.cpp
View file @
94e3a2e4
...
@@ -20,7 +20,7 @@ static void inline_submodule(module& m, instruction_ref ins, bool cond)
...
@@ -20,7 +20,7 @@ static void inline_submodule(module& m, instruction_ref ins, bool cond)
{
{
auto
val
=
out
->
get_operator
().
to_value
();
auto
val
=
out
->
get_operator
().
to_value
();
assert
(
val
.
contains
(
"index"
));
assert
(
val
.
contains
(
"index"
));
auto
index
=
val
.
at
(
"index"
).
to
<
std
::
size_
t
>
();
auto
index
=
val
.
at
(
"index"
).
to
<
in
t
>
();
m
.
replace_instruction
(
out
,
mod_outputs
.
at
(
index
));
m
.
replace_instruction
(
out
,
mod_outputs
.
at
(
index
));
}
}
}
}
...
...
src/json.cpp
View file @
94e3a2e4
...
@@ -133,7 +133,7 @@ std::string to_json_string(const value& val)
...
@@ -133,7 +133,7 @@ std::string to_json_string(const value& val)
return
j
.
dump
();
return
j
.
dump
();
}
}
migraphx
::
value
from_json_string
(
const
char
*
str
,
std
::
size_
t
size
)
migraphx
::
value
from_json_string
(
const
char
*
str
,
in
t
size
)
{
{
json
j
=
json
::
parse
(
str
,
str
+
size
);
json
j
=
json
::
parse
(
str
,
str
+
size
);
return
j
.
get
<
value
>
();
return
j
.
get
<
value
>
();
...
...
src/load_save.cpp
View file @
94e3a2e4
...
@@ -16,7 +16,7 @@ program load_buffer(const std::vector<char>& buffer, const file_options& options
...
@@ -16,7 +16,7 @@ program load_buffer(const std::vector<char>& buffer, const file_options& options
{
{
return
load_buffer
(
buffer
.
data
(),
buffer
.
size
(),
options
);
return
load_buffer
(
buffer
.
data
(),
buffer
.
size
(),
options
);
}
}
program
load_buffer
(
const
char
*
buffer
,
std
::
size_
t
size
,
const
file_options
&
options
)
program
load_buffer
(
const
char
*
buffer
,
in
t
size
,
const
file_options
&
options
)
{
{
program
p
;
program
p
;
if
(
options
.
format
==
"msgpack"
)
if
(
options
.
format
==
"msgpack"
)
...
...
src/module.cpp
View file @
94e3a2e4
...
@@ -476,7 +476,7 @@ std::unordered_map<std::string, shape> module::get_parameter_shapes() const
...
@@ -476,7 +476,7 @@ std::unordered_map<std::string, shape> module::get_parameter_shapes() const
bool
module
::
has_instruction
(
instruction_ref
ins
)
const
{
return
impl
->
contains
(
ins
);
}
bool
module
::
has_instruction
(
instruction_ref
ins
)
const
{
return
impl
->
contains
(
ins
);
}
std
::
size_
t
module
::
size
()
const
{
return
impl
->
instructions
.
size
();
}
in
t
module
::
size
()
const
{
return
impl
->
instructions
.
size
();
}
instruction_ref
module
::
begin
()
const
{
return
impl
->
instructions
.
begin
();
}
instruction_ref
module
::
begin
()
const
{
return
impl
->
instructions
.
begin
();
}
instruction_ref
module
::
end
()
const
{
return
impl
->
instructions
.
end
();
}
instruction_ref
module
::
end
()
const
{
return
impl
->
instructions
.
end
();
}
...
...
src/msgpack.cpp
View file @
94e3a2e4
...
@@ -47,7 +47,7 @@ MSGPACK_API_VERSION_NAMESPACE(MSGPACK_DEFAULT_API_NS)
...
@@ -47,7 +47,7 @@ MSGPACK_API_VERSION_NAMESPACE(MSGPACK_DEFAULT_API_NS)
}
}
case
msgpack
::
type
::
BIN
:
case
msgpack
::
type
::
BIN
:
{
{
v
=
migraphx
::
value
::
binary
{
o
.
via
.
bin
.
ptr
,
o
.
via
.
bin
.
size
};
v
=
migraphx
::
value
::
binary
{
o
.
via
.
bin
.
ptr
,
static_cast
<
int
>
(
o
.
via
.
bin
.
size
)
};
break
;
break
;
}
}
case
msgpack
::
type
::
ARRAY
:
case
msgpack
::
type
::
ARRAY
:
...
@@ -150,7 +150,7 @@ inline namespace MIGRAPHX_INLINE_NS {
...
@@ -150,7 +150,7 @@ inline namespace MIGRAPHX_INLINE_NS {
struct
vector_stream
struct
vector_stream
{
{
std
::
vector
<
char
>
buffer
{};
std
::
vector
<
char
>
buffer
{};
vector_stream
&
write
(
const
char
*
b
,
std
::
size_
t
n
)
vector_stream
&
write
(
const
char
*
b
,
in
t
n
)
{
{
buffer
.
insert
(
buffer
.
end
(),
b
,
b
+
n
);
buffer
.
insert
(
buffer
.
end
(),
b
,
b
+
n
);
return
*
this
;
return
*
this
;
...
@@ -163,7 +163,7 @@ std::vector<char> to_msgpack(const value& v)
...
@@ -163,7 +163,7 @@ std::vector<char> to_msgpack(const value& v)
msgpack
::
pack
(
vs
,
v
);
msgpack
::
pack
(
vs
,
v
);
return
vs
.
buffer
;
return
vs
.
buffer
;
}
}
value
from_msgpack
(
const
char
*
buffer
,
std
::
size_
t
size
)
value
from_msgpack
(
const
char
*
buffer
,
in
t
size
)
{
{
msgpack
::
object_handle
oh
=
msgpack
::
unpack
(
buffer
,
size
);
msgpack
::
object_handle
oh
=
msgpack
::
unpack
(
buffer
,
size
);
return
oh
.
get
().
as
<
value
>
();
return
oh
.
get
().
as
<
value
>
();
...
...
src/normalize_attributes.cpp
View file @
94e3a2e4
...
@@ -120,8 +120,8 @@ auto tune_attribute(const std::vector<int64_t>& vec,
...
@@ -120,8 +120,8 @@ auto tune_attribute(const std::vector<int64_t>& vec,
auto
tune_pad_attribute
(
const
value
&
val
)
auto
tune_pad_attribute
(
const
value
&
val
)
{
{
std
::
vector
<
size_
t
>
vec_attrs
=
val
.
to_vector
<
size_
t
>
();
std
::
vector
<
in
t
>
vec_attrs
=
val
.
to_vector
<
in
t
>
();
std
::
vector
<
size_
t
>
result
(
vec_attrs
.
begin
(),
vec_attrs
.
end
());
std
::
vector
<
in
t
>
result
(
vec_attrs
.
begin
(),
vec_attrs
.
end
());
std
::
copy
(
vec_attrs
.
begin
(),
vec_attrs
.
end
(),
std
::
back_inserter
(
result
));
std
::
copy
(
vec_attrs
.
begin
(),
vec_attrs
.
end
(),
std
::
back_inserter
(
result
));
return
result
;
return
result
;
...
...
src/onnx/checks.cpp
View file @
94e3a2e4
...
@@ -13,7 +13,7 @@ void check_arg_empty(const argument& arg, const std::string& msg)
...
@@ -13,7 +13,7 @@ void check_arg_empty(const argument& arg, const std::string& msg)
}
}
}
}
void
check_attr_sizes
(
size_
t
kdims
,
size_
t
attr_size
,
const
std
::
string
&
error_msg
)
void
check_attr_sizes
(
in
t
kdims
,
in
t
attr_size
,
const
std
::
string
&
error_msg
)
{
{
if
(
kdims
!=
attr_size
)
if
(
kdims
!=
attr_size
)
{
{
...
...
src/onnx/conv.cpp
View file @
94e3a2e4
...
@@ -5,7 +5,7 @@ namespace migraphx {
...
@@ -5,7 +5,7 @@ namespace migraphx {
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
onnx
{
namespace
onnx
{
void
recalc_conv_attributes
(
value
&
v
,
size_
t
kdims
)
void
recalc_conv_attributes
(
value
&
v
,
in
t
kdims
)
{
{
if
(
not
(
v
[
"padding"
].
size
()
==
kdims
or
v
[
"padding"
].
size
()
==
kdims
*
2
))
if
(
not
(
v
[
"padding"
].
size
()
==
kdims
or
v
[
"padding"
].
size
()
==
kdims
*
2
))
{
{
...
...
src/onnx/include/migraphx/onnx/checks.hpp
View file @
94e3a2e4
...
@@ -10,7 +10,7 @@ inline namespace MIGRAPHX_INLINE_NS {
...
@@ -10,7 +10,7 @@ inline namespace MIGRAPHX_INLINE_NS {
namespace
onnx
{
namespace
onnx
{
void
check_arg_empty
(
const
argument
&
arg
,
const
std
::
string
&
msg
);
void
check_arg_empty
(
const
argument
&
arg
,
const
std
::
string
&
msg
);
void
check_attr_sizes
(
size_
t
kdims
,
size_
t
attr_size
,
const
std
::
string
&
error_msg
);
void
check_attr_sizes
(
in
t
kdims
,
in
t
attr_size
,
const
std
::
string
&
error_msg
);
}
// namespace onnx
}
// namespace onnx
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
...
...
src/onnx/include/migraphx/onnx/conv.hpp
View file @
94e3a2e4
...
@@ -8,7 +8,7 @@ namespace migraphx {
...
@@ -8,7 +8,7 @@ namespace migraphx {
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
onnx
{
namespace
onnx
{
void
recalc_conv_attributes
(
value
&
v
,
size_
t
kdims
);
void
recalc_conv_attributes
(
value
&
v
,
in
t
kdims
);
}
// namespace onnx
}
// namespace onnx
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
...
...
src/onnx/parse_constant_fill.cpp
View file @
94e3a2e4
...
@@ -62,7 +62,7 @@ struct parse_constant_fill : op_parser<parse_constant_fill>
...
@@ -62,7 +62,7 @@ struct parse_constant_fill : op_parser<parse_constant_fill>
migraphx
::
argument
in
=
args
[
0
]
->
eval
();
migraphx
::
argument
in
=
args
[
0
]
->
eval
();
check_arg_empty
(
in
,
"ConstantFill: dynamic shape is not supported"
);
check_arg_empty
(
in
,
"ConstantFill: dynamic shape is not supported"
);
std
::
vector
<
std
::
size_
t
>
dims
;
std
::
vector
<
in
t
>
dims
;
in
.
visit
([
&
](
auto
input
)
{
dims
.
assign
(
input
.
begin
(),
input
.
end
());
});
in
.
visit
([
&
](
auto
input
)
{
dims
.
assign
(
input
.
begin
(),
input
.
end
());
});
migraphx
::
shape
s
(
type
,
dims
);
migraphx
::
shape
s
(
type
,
dims
);
std
::
vector
<
float
>
values
(
s
.
elements
(),
value
);
std
::
vector
<
float
>
values
(
s
.
elements
(),
value
);
...
@@ -76,7 +76,7 @@ struct parse_constant_fill : op_parser<parse_constant_fill>
...
@@ -76,7 +76,7 @@ struct parse_constant_fill : op_parser<parse_constant_fill>
}
}
literal
ls
=
parser
.
parse_value
(
info
.
attributes
.
at
(
"shape"
));
literal
ls
=
parser
.
parse_value
(
info
.
attributes
.
at
(
"shape"
));
std
::
vector
<
std
::
size_
t
>
dims
;
std
::
vector
<
in
t
>
dims
;
ls
.
visit
([
&
](
auto
s
)
{
dims
.
assign
(
s
.
begin
(),
s
.
end
());
});
ls
.
visit
([
&
](
auto
s
)
{
dims
.
assign
(
s
.
begin
(),
s
.
end
());
});
migraphx
::
shape
s
{
type
,
dims
};
migraphx
::
shape
s
{
type
,
dims
};
std
::
vector
<
float
>
values
(
s
.
elements
(),
value
);
std
::
vector
<
float
>
values
(
s
.
elements
(),
value
);
...
...
src/onnx/parse_constant_of_shape.cpp
View file @
94e3a2e4
...
@@ -52,7 +52,7 @@ struct parse_constant_of_shape : op_parser<parse_constant_of_shape>
...
@@ -52,7 +52,7 @@ struct parse_constant_of_shape : op_parser<parse_constant_of_shape>
migraphx
::
argument
in
=
args
[
0
]
->
eval
();
migraphx
::
argument
in
=
args
[
0
]
->
eval
();
check_arg_empty
(
in
,
"ConstantOfShape: dynamic shape is not supported"
);
check_arg_empty
(
in
,
"ConstantOfShape: dynamic shape is not supported"
);
std
::
vector
<
std
::
size_
t
>
dims
;
std
::
vector
<
in
t
>
dims
;
in
.
visit
([
&
](
auto
input
)
{
dims
.
assign
(
input
.
begin
(),
input
.
end
());
});
in
.
visit
([
&
](
auto
input
)
{
dims
.
assign
(
input
.
begin
(),
input
.
end
());
});
s
=
migraphx
::
shape
{
type
,
dims
};
s
=
migraphx
::
shape
{
type
,
dims
};
}
}
...
...
src/onnx/parse_deconvolution.cpp
View file @
94e3a2e4
...
@@ -49,7 +49,7 @@ struct parse_deconvolution : op_parser<parse_deconvolution>
...
@@ -49,7 +49,7 @@ struct parse_deconvolution : op_parser<parse_deconvolution>
if
(
not
asym_padding
)
if
(
not
asym_padding
)
{
{
size_
t
pad_ndims
=
padding
.
size
()
/
2
;
in
t
pad_ndims
=
padding
.
size
()
/
2
;
check_attr_sizes
(
kdims
,
pad_ndims
,
"PARSE_CONV_TRANSPOSE: inconsistent paddings"
);
check_attr_sizes
(
kdims
,
pad_ndims
,
"PARSE_CONV_TRANSPOSE: inconsistent paddings"
);
values
[
"padding"
].
clear
();
values
[
"padding"
].
clear
();
std
::
transform
(
padding
.
begin
(),
std
::
transform
(
padding
.
begin
(),
...
@@ -119,7 +119,7 @@ struct parse_deconvolution : op_parser<parse_deconvolution>
...
@@ -119,7 +119,7 @@ struct parse_deconvolution : op_parser<parse_deconvolution>
if
(
contains
(
info
.
attributes
,
"output_padding"
))
if
(
contains
(
info
.
attributes
,
"output_padding"
))
{
{
size_
t
non_kdims
=
dims
.
size
()
*
2
-
kdims
;
in
t
non_kdims
=
dims
.
size
()
*
2
-
kdims
;
std
::
vector
<
int64_t
>
output_padding
(
non_kdims
,
0
);
std
::
vector
<
int64_t
>
output_padding
(
non_kdims
,
0
);
copy
(
info
.
attributes
[
"output_padding"
].
ints
(),
std
::
back_inserter
(
output_padding
));
copy
(
info
.
attributes
[
"output_padding"
].
ints
(),
std
::
back_inserter
(
output_padding
));
check_attr_sizes
(
kdims
,
check_attr_sizes
(
kdims
,
...
...
src/onnx/parse_gather_elements.cpp
View file @
94e3a2e4
...
@@ -44,7 +44,7 @@ struct parse_gather_elements : op_parser<parse_gather_elements>
...
@@ -44,7 +44,7 @@ struct parse_gather_elements : op_parser<parse_gather_elements>
// to the gather operator
// to the gather operator
arg_data
=
info
.
add_instruction
(
make_op
(
"reshape"
,
{{
"dims"
,
{
data_elem_num
}}}),
arg_data
);
arg_data
=
info
.
add_instruction
(
make_op
(
"reshape"
,
{{
"dims"
,
{
data_elem_num
}}}),
arg_data
);
std
::
size_
t
elem_num
=
ind_s
.
elements
();
in
t
elem_num
=
ind_s
.
elements
();
std
::
vector
<
int
>
ind_index
(
elem_num
);
std
::
vector
<
int
>
ind_index
(
elem_num
);
std
::
iota
(
ind_index
.
begin
(),
ind_index
.
end
(),
0
);
std
::
iota
(
ind_index
.
begin
(),
ind_index
.
end
(),
0
);
...
...
src/onnx/parse_gru.cpp
View file @
94e3a2e4
...
@@ -20,11 +20,11 @@ struct parse_gru : op_parser<parse_gru>
...
@@ -20,11 +20,11 @@ struct parse_gru : op_parser<parse_gru>
std
::
vector
<
instruction_ref
>
args
)
const
std
::
vector
<
instruction_ref
>
args
)
const
{
{
migraphx
::
shape
input_shape
=
args
[
0
]
->
get_shape
();
migraphx
::
shape
input_shape
=
args
[
0
]
->
get_shape
();
std
::
size_
t
hidden_size
=
args
[
2
]
->
get_shape
().
lens
()[
2
];
in
t
hidden_size
=
args
[
2
]
->
get_shape
().
lens
()[
2
];
if
(
contains
(
info
.
attributes
,
"hidden_size"
))
if
(
contains
(
info
.
attributes
,
"hidden_size"
))
{
{
std
::
size_
t
hidden_size_att
=
in
t
hidden_size_att
=
parser
.
parse_value
(
info
.
attributes
.
at
(
"hidden_size"
)).
at
<
int
>
();
parser
.
parse_value
(
info
.
attributes
.
at
(
"hidden_size"
)).
at
<
int
>
();
if
(
hidden_size
!=
hidden_size_att
)
if
(
hidden_size
!=
hidden_size_att
)
{
{
...
...
src/onnx/parse_if.cpp
View file @
94e3a2e4
...
@@ -55,7 +55,7 @@ struct parse_if : op_parser<parse_if>
...
@@ -55,7 +55,7 @@ struct parse_if : op_parser<parse_if>
const
auto
&
vec_shapes
=
out_s
.
sub_shapes
();
const
auto
&
vec_shapes
=
out_s
.
sub_shapes
();
std
::
vector
<
instruction_ref
>
out_inss
;
std
::
vector
<
instruction_ref
>
out_inss
;
for
(
std
::
size_
t
i
=
0
;
i
<
vec_shapes
.
size
();
++
i
)
for
(
in
t
i
=
0
;
i
<
vec_shapes
.
size
();
++
i
)
{
{
auto
ret
=
info
.
add_instruction
(
make_op
(
"get_tuple_elem"
,
{{
"index"
,
i
}}),
if_ret
);
auto
ret
=
info
.
add_instruction
(
make_op
(
"get_tuple_elem"
,
{{
"index"
,
i
}}),
if_ret
);
out_inss
.
push_back
(
ret
);
out_inss
.
push_back
(
ret
);
...
...
src/onnx/parse_loop.cpp
View file @
94e3a2e4
...
@@ -57,7 +57,7 @@ struct parse_loop : op_parser<parse_loop>
...
@@ -57,7 +57,7 @@ struct parse_loop : op_parser<parse_loop>
const
auto
&
vec_shapes
=
out_s
.
sub_shapes
();
const
auto
&
vec_shapes
=
out_s
.
sub_shapes
();
std
::
vector
<
instruction_ref
>
out_inss
;
std
::
vector
<
instruction_ref
>
out_inss
;
for
(
std
::
size_
t
i
=
0
;
i
<
vec_shapes
.
size
();
++
i
)
for
(
in
t
i
=
0
;
i
<
vec_shapes
.
size
();
++
i
)
{
{
auto
r
=
info
.
add_instruction
(
make_op
(
"get_tuple_elem"
,
{{
"index"
,
i
}}),
ret
);
auto
r
=
info
.
add_instruction
(
make_op
(
"get_tuple_elem"
,
{{
"index"
,
i
}}),
ret
);
out_inss
.
push_back
(
r
);
out_inss
.
push_back
(
r
);
...
...
src/onnx/parse_lstm.cpp
View file @
94e3a2e4
...
@@ -103,11 +103,11 @@ struct parse_lstm : op_parser<parse_lstm>
...
@@ -103,11 +103,11 @@ struct parse_lstm : op_parser<parse_lstm>
std
::
vector
<
instruction_ref
>
args
)
const
std
::
vector
<
instruction_ref
>
args
)
const
{
{
migraphx
::
shape
input_shape
=
args
[
0
]
->
get_shape
();
migraphx
::
shape
input_shape
=
args
[
0
]
->
get_shape
();
std
::
size_
t
hidden_size
=
args
[
2
]
->
get_shape
().
lens
()[
2
];
in
t
hidden_size
=
args
[
2
]
->
get_shape
().
lens
()[
2
];
if
(
contains
(
info
.
attributes
,
"hidden_size"
))
if
(
contains
(
info
.
attributes
,
"hidden_size"
))
{
{
std
::
size_
t
hidden_size_att
=
in
t
hidden_size_att
=
parser
.
parse_value
(
info
.
attributes
.
at
(
"hidden_size"
)).
at
<
int
>
();
parser
.
parse_value
(
info
.
attributes
.
at
(
"hidden_size"
)).
at
<
int
>
();
if
(
hidden_size
!=
hidden_size_att
)
if
(
hidden_size
!=
hidden_size_att
)
{
{
...
...
src/onnx/parse_prefix_scan.cpp
View file @
94e3a2e4
...
@@ -15,7 +15,7 @@ instruction_ref parse_prefix_scan_oper(const std::string& op_name,
...
@@ -15,7 +15,7 @@ instruction_ref parse_prefix_scan_oper(const std::string& op_name,
{
{
migraphx
::
argument
in
=
args
[
1
]
->
eval
();
migraphx
::
argument
in
=
args
[
1
]
->
eval
();
check_arg_empty
(
in
,
"PARSE_PREFIX_SCAN: axis - dynamic shape not supported"
);
check_arg_empty
(
in
,
"PARSE_PREFIX_SCAN: axis - dynamic shape not supported"
);
std
::
vector
<
std
::
size_
t
>
axis_in
;
std
::
vector
<
in
t
>
axis_in
;
in
.
visit
([
&
](
auto
input
)
{
axis_in
.
assign
(
input
.
begin
(),
input
.
end
());
});
in
.
visit
([
&
](
auto
input
)
{
axis_in
.
assign
(
input
.
begin
(),
input
.
end
());
});
int64_t
axis
=
axis_in
[
0
];
int64_t
axis
=
axis_in
[
0
];
...
...
src/onnx/parse_range.cpp
View file @
94e3a2e4
...
@@ -34,7 +34,7 @@ struct parse_range : op_parser<parse_range>
...
@@ -34,7 +34,7 @@ struct parse_range : op_parser<parse_range>
auto
limit_val
=
limit
.
front
();
auto
limit_val
=
limit
.
front
();
auto
delta_val
=
delta
.
front
();
auto
delta_val
=
delta
.
front
();
size_
t
num_elements
=
static_cast
<
size_
t
>
(
in
t
num_elements
=
static_cast
<
in
t
>
(
ceil
(
static_cast
<
double
>
(
limit_val
-
start_val
)
/
static_cast
<
double
>
(
delta_val
)));
ceil
(
static_cast
<
double
>
(
limit_val
-
start_val
)
/
static_cast
<
double
>
(
delta_val
)));
assert
(
num_elements
>
0
);
assert
(
num_elements
>
0
);
...
...
Prev
1
2
3
4
5
6
7
8
…
13
Next
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