Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
a2d8a9fd
Commit
a2d8a9fd
authored
Jan 08, 2019
by
Nick Korovaiko
Committed by
Scott Cyphers
Jan 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add int32 support to argmin/argmax (#2288)
parent
1df4cc36
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
argmax.cpp
src/ngraph/runtime/cpu/builder/argmax.cpp
+28
-0
argmin.cpp
src/ngraph/runtime/cpu/builder/argmin.cpp
+28
-0
No files found.
src/ngraph/runtime/cpu/builder/argmax.cpp
View file @
a2d8a9fd
...
...
@@ -108,6 +108,34 @@ namespace ngraph
};
}
}
else
if
(
element_type
==
element
::
i32
)
{
if
(
is_int64
)
{
std
::
function
<
decltype
(
runtime
::
cpu
::
kernel
::
argmax
<
int
,
int64_t
,
1
>
)
>
kernel
;
SELECT_RANK2
(
kernel
,
int
,
int64_t
,
in_shape
.
size
(),
runtime
::
cpu
::
kernel
::
argmax
);
functor
=
[
&
,
kernel
,
in_shape
,
out_shape
,
axis
](
CPURuntimeContext
*
ctx
,
CPUExecutionContext
*
ectx
)
{
kernel
(
arg_tensor
,
out_tensor
,
in_shape
,
out_shape
,
axis
,
ectx
->
arena
);
};
}
else
{
std
::
function
<
decltype
(
runtime
::
cpu
::
kernel
::
argmax
<
int
,
int
,
1
>
)
>
kernel
;
SELECT_RANK2
(
kernel
,
int
,
int
,
in_shape
.
size
(),
runtime
::
cpu
::
kernel
::
argmax
);
functor
=
[
&
,
kernel
,
in_shape
,
out_shape
,
axis
](
CPURuntimeContext
*
ctx
,
CPUExecutionContext
*
ectx
)
{
kernel
(
arg_tensor
,
out_tensor
,
in_shape
,
out_shape
,
axis
,
ectx
->
arena
);
};
}
}
else
{
throw
ngraph_error
(
"Unsupported type in CPU Builder for ArgMax"
);
...
...
src/ngraph/runtime/cpu/builder/argmin.cpp
View file @
a2d8a9fd
...
...
@@ -108,6 +108,34 @@ namespace ngraph
};
}
}
else
if
(
element_type
==
element
::
i32
)
{
if
(
is_int64
)
{
std
::
function
<
decltype
(
runtime
::
cpu
::
kernel
::
argmin
<
int
,
int64_t
,
1
>
)
>
kernel
;
SELECT_RANK2
(
kernel
,
int
,
int64_t
,
in_shape
.
size
(),
runtime
::
cpu
::
kernel
::
argmin
);
functor
=
[
&
,
kernel
,
in_shape
,
out_shape
,
axis
](
CPURuntimeContext
*
ctx
,
CPUExecutionContext
*
ectx
)
{
kernel
(
arg_tensor
,
out_tensor
,
in_shape
,
out_shape
,
axis
,
ectx
->
arena
);
};
}
else
{
std
::
function
<
decltype
(
runtime
::
cpu
::
kernel
::
argmin
<
int
,
int
,
1
>
)
>
kernel
;
SELECT_RANK2
(
kernel
,
int
,
int
,
in_shape
.
size
(),
runtime
::
cpu
::
kernel
::
argmin
);
functor
=
[
&
,
kernel
,
in_shape
,
out_shape
,
axis
](
CPURuntimeContext
*
ctx
,
CPUExecutionContext
*
ectx
)
{
kernel
(
arg_tensor
,
out_tensor
,
in_shape
,
out_shape
,
axis
,
ectx
->
arena
);
};
}
}
else
{
throw
ngraph_error
(
"Unsupported type in CPU Builder for ArgMin"
);
...
...
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