* @param offset offset to the current memory block
* @param dimOffsets per-dimension offset from the padding to actual data,
*/
- BlockingDesc(const SizeVector& blocked_dims, const SizeVector& order, size_t offset, SizeVector dimOffsets);
+ BlockingDesc(const SizeVector& blocked_dims, const SizeVector& order, size_t offset, const SizeVector& dimOffsets);
/**
* @brief The constructor allows to create blocking descriptors for blocked memory
*
* @param dimOffsets per-dimension offset from the padding to actual data,
* @param strides strides for each dimension
*/
- BlockingDesc(const SizeVector& blocked_dims, const SizeVector& order, size_t offset, SizeVector dimOffsets,
- SizeVector strides);
+ BlockingDesc(const SizeVector& blocked_dims, const SizeVector& order, size_t offset,
+ const SizeVector& dimOffsets, const SizeVector& strides);
/**
* @brief Returns the blocked dimensions vector
* @param dims memory dimensions
* @param blockDesc blocking descriptor
*/
- TensorDesc(const Precision& precision, SizeVector dims, const BlockingDesc& blockDesc);
+ TensorDesc(const Precision& precision, const SizeVector& dims, const BlockingDesc& blockDesc);
/**
* @brief The constructor creates the tensor descriptor using standard layout
*
* @param dims memory dimensions
* @param layout memory layout
*/
- TensorDesc(const Precision& precision, SizeVector dims, Layout layout);
+ TensorDesc(const Precision& precision, const SizeVector& dims, Layout layout);
/**
* @brief The constructor creates the empty tensor descriptor with precision and layout
*
* @param dims the vector of dimensions
* @return the standard memory layout
*/
- static Layout getLayoutByDims(SizeVector dims);
+ static Layout getLayoutByDims(const SizeVector& dims);
private:
/**
using namespace InferenceEngine;
-TensorDesc::TensorDesc(const Precision& precision, SizeVector dims, Layout layout)
+TensorDesc::TensorDesc(const Precision& precision, const SizeVector& dims, Layout layout)
: precision(precision), blockingDesc(dims, layout) {
this->dims = dims;
this->layout = layout;
this->layout = layout;
}
-TensorDesc::TensorDesc(const Precision& precision, SizeVector dims, const BlockingDesc& blockDesc)
+TensorDesc::TensorDesc(const Precision& precision, const SizeVector& dims, const BlockingDesc& blockDesc)
: dims(dims), precision(precision), blockingDesc(blockDesc) {
if (dims.size() == 0 || blockingDesc.getBlockDims().size() == 0) {
layout = Layout::SCALAR;
return !(*this == rhs);
}
-Layout TensorDesc::getLayoutByDims(SizeVector dims) {
+Layout TensorDesc::getLayoutByDims(const SizeVector& dims) {
switch (dims.size()) {
case 0:
return Layout::SCALAR;
}
BlockingDesc::BlockingDesc(const SizeVector& blocked_dims, const SizeVector& order, size_t offset,
- SizeVector dimOffsets)
+ const SizeVector& dimOffsets)
: BlockingDesc(blocked_dims, order) {
this->offsetPadding = offset;
if (blocked_dims.size() != dimOffsets.size())
}
BlockingDesc::BlockingDesc(const SizeVector& blocked_dims, const SizeVector& order, size_t offset,
- SizeVector dimOffsets, SizeVector strides)
+ const SizeVector& dimOffsets, const SizeVector& strides)
: BlockingDesc(blocked_dims, order) {
this->offsetPadding = offset;
if (blocked_dims.size() != strides.size()) THROW_IE_EXCEPTION << "Strides are not initialized for all dimensions.";