|
| tensor (value_type default_size=0) |
|
template<typename ... KindInitTys, typename = typename std::enable_if< meta::all< meta::is_any_of<KindInitTys, cldnn::details::dim_vec_kind_init<cldnn::details::dim_vec_kind::batch>, cldnn::details::dim_vec_kind_init<cldnn::details::dim_vec_kind::feature>, cldnn::details::dim_vec_kind_init<details::dim_vec_kind::spatial> >::value... >::value, void>::type> |
| tensor (KindInitTys &&... kind_inits) |
| Constructs tensor. More...
|
|
| tensor (value_type batch_num, value_type feature_num, value_type width, value_type height) |
| Constructs tensor . More...
|
|
| tensor (const std::vector< value_type > &sizes, value_type default_size=1) |
| Constructs tensor using vector of sizes. More...
|
|
| tensor (format fmt, const std::vector< value_type > &sizes, value_type default_size=1) |
|
| tensor (const cldnn_tensor &other) |
| Implicit conversion form C API :: cldnn_tensor.
|
|
| operator cldnn_tensor () const |
| Implicit conversion to C API cldnn_tensor.
|
|
| tensor (const tensor &other) |
| Copy construction.
|
|
tensor & | operator= (const tensor &other) |
| Copy assignment.
|
|
std::string | to_string () const |
|
tensor | negate () const |
| Returns a tensor with all negated elements.
|
|
tensor | mul (value_type multiplier) const |
| Returns a tensor with all elements multilied to multiplier .
|
|
tensor | div (value_type divider) const |
| Returns a tensor with all elements divided by divider .
|
|
tensor | add (const tensor &rhs) const |
| Returns a tensor with all elements added by appropriate elements of rhs .
|
|
tensor | sub (const tensor &rhs) const |
| Returns a tensor with all elements subtracted by appropriate elements of rhs .
|
|
tensor & | operator+= (const tensor &rhs) |
| Assign and add.
|
|
tensor & | operator-= (const tensor &rhs) |
| Assign and subtract.
|
|
std::vector< value_type > | sizes (cldnn::format fmt) const |
| Returns a vector of tensors values, ordered regarding to format .
|
|
std::vector< value_type > | sizes () const |
| Returns a vector of tensors values, ordered batch, feature, spatial_x, spatial_y.
|
|
size_t | count () const |
| Returns tensor elements count calculated as multiplication of all elements.
|
|
tensor | transform (cldnn::format new_fmt, value_type default_size) const |
| Returns new tensor based on current but transformed to new format . More...
|
|
size_t | get_linear_offset (const tensor &coord, cldnn::format fmt) const |
| Calculates linear offset for given coord within current tensor. More...
|
|
N-dimensional vector. Mostly used to represent memory size.
Definition at line 256 of file tensor.hpp.
template<typename ... KindInitTys, typename = typename std::enable_if< meta::all< meta::is_any_of<KindInitTys, cldnn::details::dim_vec_kind_init<cldnn::details::dim_vec_kind::batch>, cldnn::details::dim_vec_kind_init<cldnn::details::dim_vec_kind::feature>, cldnn::details::dim_vec_kind_init<details::dim_vec_kind::spatial> >::value... >::value, void>::type>
cldnn::tensor::tensor |
( |
KindInitTys &&... |
kind_inits | ) |
|
|
inline |
Constructs tensor.
- Parameters
-
[in] | kind_inits | Dimensions defined using dim_vec_kind. If dimension is not provided it is set to 1. |
Example:
cout << my_tensor.batch[0] << endl;
cout << my_tensor.feature[0] << endl;
cout << "x=" << my_tensor.spatial[0] << endl;
cout << "y=" << my_tensor.spatial[1] << endl;
Definition at line 306 of file tensor.hpp.