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
9d26970c
Commit
9d26970c
authored
May 20, 2019
by
Adam Rogowiec
Committed by
arogowie-intel
May 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Constant::create instead of make_constant.
parent
5761f145
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
lstm.cpp
src/ngraph/frontend/onnx_import/op/lstm.cpp
+18
-10
No files found.
src/ngraph/frontend/onnx_import/op/lstm.cpp
View file @
9d26970c
...
@@ -99,8 +99,11 @@ namespace ngraph
...
@@ -99,8 +99,11 @@ namespace ngraph
}
}
else
else
{
{
m_map
[
LSTMInput
::
LSTM_INPUT_B
]
=
ngraph
::
builder
::
make_constant
<
float
>
(
m_map
[
LSTMInput
::
LSTM_INPUT_B
]
=
ngraph
::
op
::
Constant
::
create
(
element
::
f32
,
{
num_directions
,
2
*
gates_count
*
hidden_size
},
0.
f
);
element
::
f32
,
Shape
{
num_directions
,
2
*
gates_count
*
hidden_size
},
std
::
vector
<
float
>
(
num_directions
*
2
*
gates_count
*
hidden_size
,
0.
f
));
}
}
// The lengths of the sequences in a batch. Shape [batch_size]
// The lengths of the sequences in a batch. Shape [batch_size]
if
(
ng_inputs
.
size
()
>
4
&&
!
ng_inputs
.
at
(
4
)
->
is_null
())
if
(
ng_inputs
.
size
()
>
4
&&
!
ng_inputs
.
at
(
4
)
->
is_null
())
...
@@ -122,9 +125,10 @@ namespace ngraph
...
@@ -122,9 +125,10 @@ namespace ngraph
}
}
else
else
{
{
m_map
[
LSTMInput
::
LSTM_INPUT_INIT_H
]
=
m_map
[
LSTMInput
::
LSTM_INPUT_INIT_H
]
=
ngraph
::
op
::
Constant
::
create
(
ngraph
::
builder
::
make_constant
<
float
>
(
element
::
f32
,
element
::
f32
,
{
num_directions
,
batch_size
,
hidden_size
},
0.
f
);
Shape
{
num_directions
,
batch_size
,
hidden_size
},
std
::
vector
<
float
>
(
num_directions
*
batch_size
*
hidden_size
,
0.
f
));
}
}
// The initial value of the cell. Shape [num_directions, batch_size, hidden_size]
// The initial value of the cell. Shape [num_directions, batch_size, hidden_size]
if
(
ng_inputs
.
size
()
>
6
&&
!
ng_inputs
.
at
(
6
)
->
is_null
())
if
(
ng_inputs
.
size
()
>
6
&&
!
ng_inputs
.
at
(
6
)
->
is_null
())
...
@@ -133,9 +137,10 @@ namespace ngraph
...
@@ -133,9 +137,10 @@ namespace ngraph
}
}
else
else
{
{
m_map
[
LSTMInput
::
LSTM_INPUT_INIT_C
]
=
m_map
[
LSTMInput
::
LSTM_INPUT_INIT_C
]
=
ngraph
::
op
::
Constant
::
create
(
ngraph
::
builder
::
make_constant
<
float
>
(
element
::
f32
,
element
::
f32
,
{
num_directions
,
batch_size
,
hidden_size
},
0.
f
);
Shape
{
num_directions
,
batch_size
,
hidden_size
},
std
::
vector
<
float
>
(
num_directions
*
batch_size
*
hidden_size
,
0.
f
));
}
}
// The weight tensor for peepholes. Shape [num_directions, 3*hidde_size]
// The weight tensor for peepholes. Shape [num_directions, 3*hidde_size]
if
(
ng_inputs
.
size
()
>
7
&&
!
ng_inputs
.
at
(
7
)
->
is_null
())
if
(
ng_inputs
.
size
()
>
7
&&
!
ng_inputs
.
at
(
7
)
->
is_null
())
...
@@ -144,8 +149,11 @@ namespace ngraph
...
@@ -144,8 +149,11 @@ namespace ngraph
}
}
else
else
{
{
m_map
[
LSTMInput
::
LSTM_INPUT_P
]
=
ngraph
::
builder
::
make_constant
<
float
>
(
m_map
[
LSTMInput
::
LSTM_INPUT_P
]
=
ngraph
::
op
::
Constant
::
create
(
element
::
f32
,
{
num_directions
,
peepholes_count
*
hidden_size
},
0.
f
);
element
::
f32
,
Shape
{
num_directions
,
peepholes_count
*
hidden_size
},
std
::
vector
<
float
>
(
num_directions
*
peepholes_count
*
hidden_size
,
0.
f
));
}
}
}
}
...
...
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