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
db7d8587
Commit
db7d8587
authored
Oct 06, 2017
by
Jai Menon
Committed by
GitHub
Oct 06, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into jmenon/codegen
parents
118e0679
5cb33878
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
23 deletions
+30
-23
tensor_view_layout.hpp
src/ngraph/descriptor/layout/tensor_view_layout.hpp
+4
-9
execute.cpp
test/execute.cpp
+26
-14
No files found.
src/ngraph/descriptor/layout/tensor_view_layout.hpp
View file @
db7d8587
...
...
@@ -35,7 +35,7 @@ namespace ngraph
{
protected
:
TensorViewLayout
(
const
ngraph
::
descriptor
::
TensorView
&
tensor_view
)
:
m_tensor_view
(
tensor_view
)
:
m_tensor_view
_type
(
tensor_view
.
get_tensor_view_type
()
)
{
}
...
...
@@ -53,19 +53,14 @@ namespace ngraph
const
element
::
Type
&
get_element_type
()
const
{
return
m_tensor_view
.
get_tensor_view_type
()
->
get_element_type
();
return
m_tensor_view
_type
->
get_element_type
();
}
const
Shape
&
get_shape
()
const
{
return
m_tensor_view
.
get_tensor_view_type
()
->
get_shape
();
}
const
Shape
&
get_shape
()
const
{
return
m_tensor_view_type
->
get_shape
();
}
/// Where this view is located in the buffer.
const
BufferPos
&
get_buffer_pos
()
const
{
return
m_buffer_pos
;
}
BufferPos
&
get_buffer_pos
()
{
return
m_buffer_pos
;
}
protected
:
const
ngraph
::
descriptor
::
TensorView
&
m_tensor_view
;
std
::
shared_ptr
<
const
TensorViewType
>
m_tensor_view_type
;
BufferPos
m_buffer_pos
;
};
}
...
...
test/execute.cpp
View file @
db7d8587
...
...
@@ -341,14 +341,19 @@ TEST(execute, test_concat_vector)
TEST
(
execute
,
test_divide
)
{
auto
shape
=
Shape
{
2
,
2
};
auto
A
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape
);
auto
B
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape
);
auto
rt
=
make_shared
<
TensorViewType
>
(
element
::
Float32
::
element_type
(),
shape
);
auto
f
=
make_shared
<
Function
>
(
make_shared
<
op
::
Divide
>
(
A
,
B
),
rt
,
op
::
Parameters
{
A
,
B
});
auto
make_external
=
[]()
{
auto
shape
=
Shape
{
2
,
2
};
auto
A
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape
);
auto
B
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape
);
auto
rt
=
make_shared
<
TensorViewType
>
(
element
::
Float32
::
element_type
(),
shape
);
auto
f
=
make_shared
<
Function
>
(
make_shared
<
op
::
Divide
>
(
A
,
B
),
rt
,
op
::
Parameters
{
A
,
B
});
auto
external
=
make_shared
<
ngraph
::
runtime
::
ExternalFunction
>
(
f
);
auto
cf
=
external
->
make_call_frame
();
auto
external
=
make_shared
<
ngraph
::
runtime
::
ExternalFunction
>
(
f
);
return
external
;
};
auto
shape
=
Shape
{
2
,
2
};
auto
cf
=
make_external
()
->
make_call_frame
();
// Create some tensors for input/output
auto
a
=
ngraph
::
runtime
::
make_tensor
<
element
::
Float32
>
(
shape
);
...
...
@@ -408,16 +413,23 @@ TEST(execute, test_dot_0_0)
TEST
(
execute
,
test_dot_matrix_2x0_0x2
)
{
auto
make_external
=
[]()
{
auto
shape_a
=
Shape
{
2
,
0
};
auto
A
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape_a
);
auto
shape_b
=
Shape
{
0
,
2
};
auto
B
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape_b
);
auto
shape_r
=
Shape
{
2
,
2
};
auto
rt
=
make_shared
<
TensorViewType
>
(
element
::
Float32
::
element_type
(),
shape_r
);
auto
f
=
make_shared
<
Function
>
(
make_shared
<
op
::
Dot
>
(
A
,
B
),
rt
,
op
::
Parameters
{
A
,
B
});
auto
external
=
make_shared
<
ngraph
::
runtime
::
ExternalFunction
>
(
f
);
return
external
;
};
auto
shape_a
=
Shape
{
2
,
0
};
auto
A
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape_a
);
auto
shape_b
=
Shape
{
0
,
2
};
auto
B
=
make_shared
<
op
::
Parameter
>
(
element
::
Float32
::
element_type
(),
shape_b
);
auto
shape_r
=
Shape
{
2
,
2
};
auto
rt
=
make_shared
<
TensorViewType
>
(
element
::
Float32
::
element_type
(),
shape_r
);
auto
f
=
make_shared
<
Function
>
(
make_shared
<
op
::
Dot
>
(
A
,
B
),
rt
,
op
::
Parameters
{
A
,
B
});
auto
external
=
make_shared
<
ngraph
::
runtime
::
ExternalFunction
>
(
f
);
auto
cf
=
external
->
make_call_frame
();
auto
cf
=
make_external
()
->
make_call_frame
();
// Create some tensors for input/output
auto
a
=
ngraph
::
runtime
::
make_tensor
<
element
::
Float32
>
(
shape_a
);
...
...
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