Fixed typo in length (#5611)

This commit is contained in:
Ilya Lavrenov authored and GitHub committed 2021-05-13 07:52:55 +03:00
1 parent 39fde540d2
commit 07a49184c0
39 files changed
+122 -122

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ Where D is the rank of input tensor `data`. The sum of elements in `split_length
* **2**: `axis`. Axis along `data` to split. A scalar of type `T2` with value from range `-rank(data) .. rank(data)-1`. Negative values address dimensions from the end.
**Required.**
* **3**: `split_lengths`. A list containing the dimension values of each output tensor shape along the split `axis`. A 1D tensor of type `T2`. The number of elements in `split_lengths` determines the number of outputs. The sum of elements in `split_lengths` must match `data.shape[axis]`. In addition `split_lenghts` can contain a single `-1` element, which means, all remaining items along specified `axis` that are not consumed by other parts. **Required.**
* **3**: `split_lengths`. A list containing the dimension values of each output tensor shape along the split `axis`. A 1D tensor of type `T2`. The number of elements in `split_lengths` determines the number of outputs. The sum of elements in `split_lengths` must match `data.shape[axis]`. In addition `split_lengths` can contain a single `-1` element, which means, all remaining items along specified `axis` that are not consumed by other parts. **Required.**
**Outputs**
@@ -24,7 +24,7 @@ public:
LSTMSequenceIE(const Output <Node> &X,
const Output <Node> &H_t,
const Output <Node> &C_t,
const Output <Node> &seq_lenghts,
const Output <Node> &seq_lengths,
const Output <Node> &WR,
const Output <Node> &B,
size_t hidden_size,
@@ -16,7 +16,7 @@ NGRAPH_RTTI_DEFINITION(op::GRUSequenceIE, "GRUSequenceIE", 4);
op::GRUSequenceIE::GRUSequenceIE(const Output<Node>& X,
const Output<Node>& H_t,
const Output<Node>& seq_lenghts,
const Output<Node>& seq_lengths,
const Output<Node>& WR,
const Output<Node>& B,
std::size_t hidden_size,
@@ -27,7 +27,7 @@ op::GRUSequenceIE::GRUSequenceIE(const Output<Node>& X,
float clip,
bool linear_before_reset,
int64_t seq_axis)
: RNNCellBase({X, H_t, seq_lenghts, WR, B}, hidden_size, clip, activations, activations_alpha, activations_beta),
: RNNCellBase({X, H_t, seq_lengths, WR, B}, hidden_size, clip, activations, activations_alpha, activations_beta),
m_direction(direction),
m_linear_before_reset(linear_before_reset),
m_seq_axis(seq_axis) {
@@ -50,7 +50,7 @@ void op::GRUSequenceIE::validate_and_infer_types() {
auto b_pshape = get_input_partial_shape(4);
std::vector<ngraph::PartialShape> pshapes = {x_pshape, h_state_pshape, seq_lengths_pshape, wr_pshape, b_pshape};
std::vector<std::string> in_names = {"X", "H", "seq_lenghts", "WR", "B"};
std::vector<std::string> in_names = {"X", "H", "seq_lengths", "WR", "B"};
// num_direction dimension should be squeezed, we don't support bidirectional case
std::vector<size_t> ranks = {3, 2, 1, 2, 1};
for (size_t i = 0; i < pshapes.size(); ++i) {
@@ -17,7 +17,7 @@ NGRAPH_RTTI_DEFINITION(op::LSTMSequenceIE, "LSTMSequenceIE", 5);
op::LSTMSequenceIE::LSTMSequenceIE(const Output<Node> &X,
const Output<Node> &H_t,
const Output<Node> &C_t,
const Output<Node> &seq_lenghts,
const Output<Node> &seq_lengths,
const Output<Node> &WR,
const Output<Node> &B,
std::size_t hidden_size,
@@ -27,7 +27,7 @@ op::LSTMSequenceIE::LSTMSequenceIE(const Output<Node> &X,
const std::vector<float> &activations_beta,
float clip,
int64_t seq_axis)
: RNNCellBase({X, H_t, C_t, seq_lenghts, WR, B}, hidden_size, clip, activations, activations_alpha, activations_beta),
: RNNCellBase({X, H_t, C_t, seq_lengths, WR, B}, hidden_size, clip, activations, activations_alpha, activations_beta),
m_direction(direction),
m_seq_axis(seq_axis) {
constructor_validate_and_infer_types();
@@ -52,7 +52,7 @@ void op::LSTMSequenceIE::validate_and_infer_types() {
std::vector<ngraph::PartialShape> pshapes = {x_pshape, h_state_pshape, c_state_pshape,
seq_lengths_pshape, wr_pshape, b_pshape};
std::vector<std::string> in_names = {"X", "H", "C", "seq_lenghts", "WR", "B"};
std::vector<std::string> in_names = {"X", "H", "C", "seq_lengths", "WR", "B"};
// num_direction dimension should be squeezed, we don't support bidirectional case
std::vector<size_t> ranks = {3, 2, 2, 1, 2, 1};
for (size_t i = 0; i < pshapes.size(); ++i) {
@@ -48,7 +48,7 @@ void op::RNNSequenceIE::validate_and_infer_types() {
auto b_pshape = get_input_partial_shape(4);
std::vector<ngraph::PartialShape> pshapes = {x_pshape, h_state_pshape, seq_lengths_pshape, wr_pshape, b_pshape};
std::vector<std::string> in_names = {"X", "H", "seq_lenghts", "WR", "B"};
std::vector<std::string> in_names = {"X", "H", "seq_lengths", "WR", "B"};
// num_direction dimension should be squeezed, we don't support bidirectional case
std::vector<size_t> ranks = {3, 2, 1, 2, 1};
for (size_t i = 0; i < pshapes.size(); ++i) {
@@ -81,13 +81,13 @@ std::vector<std::string> MyriadMetrics::AvailableDevicesNames(
std::string MyriadMetrics::FullName(std::string deviceName) const {
std::string nameDelimiter("-ma");
unsigned int indexLenght = 4;
unsigned int indexLength = 4;
unsigned int placeOfTypeId = 2;
auto indexStr = deviceName;
indexStr.erase(0, indexStr.find(nameDelimiter) + nameDelimiter.length());
if (indexLenght != indexStr.length()) {
if (indexLength != indexStr.length()) {
return deviceName;
} else {
auto myriadId = std::string(1, indexStr[placeOfTypeId]);
@@ -64,7 +64,7 @@ TEST(ONNX_Reader_Tests, ImportModelWithExternalDataFromStringException) {
EXPECT_PRED_FORMAT2(
testing::IsSubstring,
std::string("data/tensor.data, offset: 0, data_lenght: 0, sha1_digest: 0)"),
std::string("data/tensor.data, offset: 0, data_length: 0, sha1_digest: 0)"),
e.what());
}
catch(...) {
@@ -229,7 +229,7 @@ TEST(TransformationTests, LSTMSequenceConversionTest) {
ngraph::Shape{batch_size, num_directions, hidden_size});
const auto C_t = std::make_shared<ngraph::opset5::Parameter>(ngraph::element::f32,
ngraph::Shape{batch_size, num_directions, hidden_size});
const auto seq_lenghts = std::make_shared<ngraph::opset5::Constant>(ngraph::element::f32,
const auto seq_lengths = std::make_shared<ngraph::opset5::Constant>(ngraph::element::f32,
ngraph::Shape{batch_size});
const auto B = std::make_shared<ngraph::opset5::Constant>(ngraph::element::f32,
ngraph::Shape{num_directions,
@@ -245,7 +245,7 @@ TEST(TransformationTests, LSTMSequenceConversionTest) {
auto sequence_ie = std::make_shared<ngraph::op::LSTMSequenceIE>(X,
in_1,
in_2,
seq_lenghts,
seq_lengths,
in_3,
in_4,
sequence->get_hidden_size(),
@@ -16,7 +16,7 @@ namespace {
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_PARAM,
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_CONST,
ngraph::helpers::SequenceTestsMode::PURE_SEQ};
// output values increase rapidly without clip, so use only seq_lenghts = 2
// output values increase rapidly without clip, so use only seq_lengths = 2
std::vector<size_t> seq_lengths_zero_clip{2};
std::vector<size_t> seq_lengths_clip_non_zero{20};
std::vector<size_t> batch{10};
@@ -9,7 +9,7 @@
using namespace LayerTestsDefinitions;
namespace {
// without clip values increase rapidly, so use only seq_lenghts = 2
// without clip values increase rapidly, so use only seq_lengths = 2
std::vector<bool> execute_first_iteration{true};
std::vector<bool> is_body_condition_const{true/*, false*/};
std::vector<bool> body_condition{true/*, false*/}; // works only if is_body_condition_const == true
@@ -16,7 +16,7 @@ namespace {
ngraph::helpers::SequenceTestsMode::PURE_SEQ,
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_CONST,
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_PARAM};
// output values increase rapidly without clip, so use only seq_lenghts = 2
// output values increase rapidly without clip, so use only seq_lengths = 2
std::vector<size_t> seq_lengths_zero_clip{2};
std::vector<size_t> seq_lengths_clip_non_zero{20};
std::vector<size_t> batch{10};
@@ -16,7 +16,7 @@ namespace {
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_PARAM,
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_CONST,
ngraph::helpers::SequenceTestsMode::PURE_SEQ};
// output values increase rapidly without clip, so use only seq_lenghts = 2
// output values increase rapidly without clip, so use only seq_lengths = 2
std::vector<size_t> seq_lengths_zero_clip{2};
std::vector<size_t> seq_lengths_clip_non_zero{20};
std::vector<size_t> batch{1, 10};
@@ -11,7 +11,7 @@ using namespace LayerTestsDefinitions;
namespace {
std::vector<bool> should_decompose = {true, false};
// output values increase rapidly without clip, so use only seq_lenghts = 2
// output values increase rapidly without clip, so use only seq_lengths = 2
std::vector<size_t> seq_lengths_zero_clip{2};
std::vector<size_t> seq_lengths_clip_non_zero{20};
std::vector<size_t> batch{1, 10};
@@ -46,7 +46,7 @@ protected:
CPUSpecificParams cpuParams;
std::map<std::string, std::string> additionalConfig;
size_t seq_lenghts;
size_t seq_lengths;
size_t batch;
size_t hidden_size;
size_t input_size = 10;
@@ -60,11 +60,11 @@ protected:
std::tie(basicParamsSet, cpuParams, additionalConfig) = this->GetParam();
std::tie(inFmts, outFmts, priority, selectedType) = cpuParams;
std::tie(m_mode, seq_lenghts, batch, hidden_size, activations, clip, linear_before_reset, direction, netPrecision, targetDevice) = basicParamsSet;
std::tie(m_mode, seq_lengths, batch, hidden_size, activations, clip, linear_before_reset, direction, netPrecision, targetDevice) = basicParamsSet;
size_t num_directions = direction == ngraph::op::RecurrentSequenceDirection::BIDIRECTIONAL ? 2 : 1;
std::vector<std::vector<size_t>> inputShapes = {
{{batch, seq_lenghts, input_size},
{{batch, seq_lengths, input_size},
{batch, num_directions, hidden_size},
{batch},
{num_directions, 3 * hidden_size, input_size},
@@ -89,7 +89,7 @@ protected:
selectedType += "_";
selectedType += outPrc.name();
m_max_seq_len = seq_lenghts;
m_max_seq_len = seq_lengths;
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(Precision::FP32);
auto params = ngraph::builder::makeParams(ngPrc, {inputShapes[0], inputShapes[1]});
if (m_mode == ngraph::helpers::SequenceTestsMode::CONVERT_TO_TI_MAX_SEQ_LEN_PARAM
@@ -174,7 +174,7 @@ CPUSpecificParams cpuParams{{ntc, ntc}, {tnc, ntc}, {"ref_any"}, "ref_any"};
CPUSpecificParams cpuParamsBatchSizeOne{{ntc, ntc}, {tnc, ntc}, {"ref_any"}, "ref_any"};;
std::vector<ngraph::helpers::SequenceTestsMode> mode{ngraph::helpers::SequenceTestsMode::PURE_SEQ};
// output values increase rapidly without clip, so use only seq_lenghts = 2
// output values increase rapidly without clip, so use only seq_lengths = 2
std::vector<size_t> seq_lengths_zero_clip{2};
std::vector<size_t> batch{10};
std::vector<size_t> batch_size_one{1};
@@ -47,7 +47,7 @@ protected:
CPUSpecificParams cpuParams;
std::map<std::string, std::string> additionalConfig;
size_t seq_lenghts;
size_t seq_lengths;
size_t batch;
size_t hidden_size;
size_t input_size;
@@ -60,12 +60,12 @@ protected:
std::tie(basicParamsSet, cpuParams, additionalConfig) = this->GetParam();
std::tie(inFmts, outFmts, priority, selectedType) = cpuParams;
std::tie(m_mode, seq_lenghts, batch, hidden_size, input_size, activations, clip, direction, netPrecision, targetDevice) = basicParamsSet;
std::tie(m_mode, seq_lengths, batch, hidden_size, input_size, activations, clip, direction, netPrecision, targetDevice) = basicParamsSet;
size_t num_directions = direction == ngraph::op::RecurrentSequenceDirection::BIDIRECTIONAL ? 2 : 1;
m_max_seq_len = seq_lenghts;
m_max_seq_len = seq_lengths;
std::vector<std::vector<size_t>> inputShapes = {
{{batch, seq_lenghts, input_size},
{{batch, seq_lengths, input_size},
{batch, num_directions, hidden_size},
{batch, num_directions, hidden_size},
{batch},
@@ -46,7 +46,7 @@ protected:
CPUSpecificParams cpuParams;
std::map<std::string, std::string> additionalConfig;
size_t seq_lenghts;
size_t seq_lengths;
size_t batch;
size_t hidden_size;
size_t input_size;
@@ -59,11 +59,11 @@ protected:
std::tie(basicParamsSet, cpuParams, additionalConfig) = this->GetParam();
std::tie(inFmts, outFmts, priority, selectedType) = cpuParams;
std::tie(m_mode, seq_lenghts, batch, hidden_size, input_size, activations, clip, direction, netPrecision, targetDevice) = basicParamsSet;
std::tie(m_mode, seq_lengths, batch, hidden_size, input_size, activations, clip, direction, netPrecision, targetDevice) = basicParamsSet;
size_t num_directions = direction == ngraph::op::RecurrentSequenceDirection::BIDIRECTIONAL ? 2 : 1;
std::vector<std::vector<size_t>> inputShapes = {
{{batch, seq_lenghts, input_size},
{{batch, seq_lengths, input_size},
{batch, num_directions, hidden_size},
{batch},
{num_directions, hidden_size, input_size},
@@ -82,7 +82,7 @@ protected:
selectedType += "_";
selectedType += outPrc.name();
m_max_seq_len = seq_lenghts;
m_max_seq_len = seq_lengths;
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(Precision::FP32);
auto params = ngraph::builder::makeParams(ngPrc, {inputShapes[0], inputShapes[1]});
if (m_mode == ngraph::helpers::SequenceTestsMode::CONVERT_TO_TI_MAX_SEQ_LEN_PARAM
@@ -152,7 +152,7 @@ CPUSpecificParams cpuParams{{ntc, ntc}, {tnc, ntc}, {"ref_any"}, "ref_any"};
CPUSpecificParams cpuParamsBatchSizeOne{{ntc, ntc}, {tnc, ntc}, {"ref_any"}, "ref_any"};
std::vector<ngraph::helpers::SequenceTestsMode> mode{ngraph::helpers::SequenceTestsMode::PURE_SEQ};
// output values increase rapidly without clip, so use only seq_lenghts = 2
// output values increase rapidly without clip, so use only seq_lengths = 2
std::vector<size_t> seq_lengths_zero_clip{2};
std::vector<size_t> batch{10};
std::vector<size_t> batch_size_one{1};
@@ -16,7 +16,7 @@ namespace {
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_CONST,
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_PARAM,
ngraph::helpers::SequenceTestsMode::PURE_SEQ};
// output values increase rapidly without clip, so use only seq_lenghts = 2
// output values increase rapidly without clip, so use only seq_lengths = 2
std::vector<size_t> seq_lengths_zero_clip{2};
std::vector<size_t> seq_lengths_clip_non_zero{20};
std::vector<size_t> batch{10};
@@ -16,7 +16,7 @@ std::vector<ngraph::helpers::SequenceTestsMode> mode{ngraph::helpers::SequenceTe
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_CONST,
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_PARAM,
ngraph::helpers::SequenceTestsMode::PURE_SEQ};
// output values increase rapidly without clip, so use only seq_lenghts = 2
// output values increase rapidly without clip, so use only seq_lengths = 2
std::vector<size_t> seq_lengths_zero_clip{2};
std::vector<size_t> seq_lengths_clip_non_zero{20};
std::vector<size_t> batch{10};
@@ -16,7 +16,7 @@ std::vector<ngraph::helpers::SequenceTestsMode> mode{ngraph::helpers::SequenceTe
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_CONST,
ngraph::helpers::SequenceTestsMode::PURE_SEQ_RAND_SEQ_LEN_PARAM,
ngraph::helpers::SequenceTestsMode::PURE_SEQ};
// output values increase rapidly without clip, so use only seq_lenghts = 2
// output values increase rapidly without clip, so use only seq_lengths = 2
std::vector<size_t> seq_lengths_zero_clip{2};
std::vector<size_t> seq_lengths_clip_non_zero{20};
std::vector<size_t> batch{1, 10};
@@ -14,7 +14,7 @@ namespace LayerTestsDefinitions {
typedef std::tuple<
std::vector<size_t>, // Logits shapes
std::vector<int>, // logits lenght
std::vector<int>, // logits length
std::vector<std::vector<int>>, // labels
std::vector<int>, // labels length
int, // blank index
@@ -10,7 +10,7 @@ namespace LayerTestsDefinitions {
std::string GRUSequenceTest::getTestCaseName(const testing::TestParamInfo<GRUSequenceParams> &obj) {
ngraph::helpers::SequenceTestsMode mode;
size_t seq_lenghts;
size_t seq_lengths;
size_t batch;
size_t hidden_size;
size_t input_size = 10;
@@ -22,7 +22,7 @@ namespace LayerTestsDefinitions {
ngraph::op::RecurrentSequenceDirection direction;
InferenceEngine::Precision netPrecision;
std::string targetDevice;
std::tie(mode, seq_lenghts, batch, hidden_size, activations, clip, linear_before_reset, direction, netPrecision,
std::tie(mode, seq_lengths, batch, hidden_size, activations, clip, linear_before_reset, direction, netPrecision,
targetDevice) = obj.param;
std::vector<std::vector<size_t>> inputShapes = {
{{batch, input_size}, {batch, hidden_size}, {batch, hidden_size}, {3 * hidden_size, input_size},
@@ -30,7 +30,7 @@ namespace LayerTestsDefinitions {
};
std::ostringstream result;
result << "mode=" << mode << "_";
result << "seq_lenghts=" << seq_lenghts << "_";
result << "seq_lengths=" << seq_lengths << "_";
result << "batch=" << batch << "_";
result << "hidden_size=" << hidden_size << "_";
result << "input_size=" << input_size << "_";
@@ -45,7 +45,7 @@ namespace LayerTestsDefinitions {
void GRUSequenceTest::SetUp() {
using namespace ngraph::helpers;
size_t seq_lenghts;
size_t seq_lengths;
size_t batch;
size_t hidden_size;
size_t input_size = 10;
@@ -56,15 +56,15 @@ namespace LayerTestsDefinitions {
bool linear_before_reset;
ngraph::op::RecurrentSequenceDirection direction;
InferenceEngine::Precision netPrecision;
std::tie(m_mode, seq_lenghts, batch, hidden_size, activations, clip, linear_before_reset, direction, netPrecision,
std::tie(m_mode, seq_lengths, batch, hidden_size, activations, clip, linear_before_reset, direction, netPrecision,
targetDevice) = this->GetParam();
size_t num_directions = direction == ngraph::op::RecurrentSequenceDirection::BIDIRECTIONAL ? 2 : 1;
std::vector<std::vector<size_t>> inputShapes = {
{{batch, seq_lenghts, input_size}, {batch, num_directions, hidden_size}, {batch},
{{batch, seq_lengths, input_size}, {batch, num_directions, hidden_size}, {batch},
{num_directions, 3 * hidden_size, input_size}, {num_directions, 3 * hidden_size, hidden_size},
{num_directions, (linear_before_reset ? 4 : 3) * hidden_size}},
};
m_max_seq_len = seq_lenghts;
m_max_seq_len = seq_lengths;
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {inputShapes[0], inputShapes[1]});
if (m_mode == SequenceTestsMode::CONVERT_TO_TI_MAX_SEQ_LEN_PARAM ||
@@ -11,7 +11,7 @@ namespace LayerTestsDefinitions {
std::string LSTMSequenceTest::getTestCaseName(const testing::TestParamInfo<LSTMSequenceParams> &obj) {
ngraph::helpers::SequenceTestsMode mode;
size_t seq_lenghts;
size_t seq_lengths;
size_t batch;
size_t hidden_size;
size_t input_size;
@@ -22,7 +22,7 @@ namespace LayerTestsDefinitions {
ngraph::op::RecurrentSequenceDirection direction;
InferenceEngine::Precision netPrecision;
std::string targetDevice;
std::tie(mode, seq_lenghts, batch, hidden_size, input_size, activations, clip, direction, netPrecision,
std::tie(mode, seq_lengths, batch, hidden_size, input_size, activations, clip, direction, netPrecision,
targetDevice) = obj.param;
std::vector<std::vector<size_t>> inputShapes = {
{{batch, input_size}, {batch, hidden_size}, {batch, hidden_size}, {4 * hidden_size, input_size},
@@ -30,7 +30,7 @@ namespace LayerTestsDefinitions {
};
std::ostringstream result;
result << "mode=" << mode << "_";
result << "seq_lenghts=" << seq_lenghts << "_";
result << "seq_lengths=" << seq_lengths << "_";
result << "batch=" << batch << "_";
result << "hidden_size=" << hidden_size << "_";
result << "input_size=" << input_size << "_";
@@ -46,7 +46,7 @@ namespace LayerTestsDefinitions {
void LSTMSequenceTest::SetUp() {
using namespace ngraph::helpers;
using namespace ngraph::builder;
size_t seq_lenghts;
size_t seq_lengths;
size_t batch;
size_t hidden_size;
@@ -57,12 +57,12 @@ namespace LayerTestsDefinitions {
float clip;
ngraph::op::RecurrentSequenceDirection direction;
InferenceEngine::Precision netPrecision;
std::tie(m_mode, seq_lenghts, batch, hidden_size, input_size, activations, clip, direction, netPrecision,
std::tie(m_mode, seq_lengths, batch, hidden_size, input_size, activations, clip, direction, netPrecision,
targetDevice) = this->GetParam();
size_t num_directions = direction == ngraph::op::RecurrentSequenceDirection::BIDIRECTIONAL ? 2 : 1;
m_max_seq_len = seq_lenghts;
m_max_seq_len = seq_lengths;
std::vector<std::vector<size_t>> inputShapes = {
{{batch, seq_lenghts, input_size}, {batch, num_directions, hidden_size}, {batch, num_directions, hidden_size},
{{batch, seq_lengths, input_size}, {batch, num_directions, hidden_size}, {batch, num_directions, hidden_size},
{batch}, {num_directions, 4 * hidden_size, input_size}, {num_directions, 4 * hidden_size, hidden_size}, {num_directions, 4 * hidden_size}},
};
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
@@ -10,7 +10,7 @@ namespace LayerTestsDefinitions {
std::string RNNSequenceTest::getTestCaseName(const testing::TestParamInfo<RNNSequenceParams> &obj) {
ngraph::helpers::SequenceTestsMode mode;
size_t seq_lenghts;
size_t seq_lengths;
size_t batch;
size_t hidden_size;
size_t input_size;
@@ -21,7 +21,7 @@ namespace LayerTestsDefinitions {
ngraph::op::RecurrentSequenceDirection direction;
InferenceEngine::Precision netPrecision;
std::string targetDevice;
std::tie(mode, seq_lenghts, batch, hidden_size, input_size, activations, clip, direction, netPrecision,
std::tie(mode, seq_lengths, batch, hidden_size, input_size, activations, clip, direction, netPrecision,
targetDevice) = obj.param;
std::vector<std::vector<size_t>> inputShapes = {
{{batch, input_size}, {batch, hidden_size}, {batch, hidden_size}, {hidden_size, input_size},
@@ -29,7 +29,7 @@ namespace LayerTestsDefinitions {
};
std::ostringstream result;
result << "mode=" << mode << "_";
result << "seq_lenghts=" << seq_lenghts << "_";
result << "seq_lengths=" << seq_lengths << "_";
result << "batch=" << batch << "_";
result << "hidden_size=" << hidden_size << "_";
result << "input_size=" << input_size << "_";
@@ -44,7 +44,7 @@ namespace LayerTestsDefinitions {
void RNNSequenceTest::SetUp() {
using namespace ngraph::helpers;
size_t seq_lenghts;
size_t seq_lengths;
size_t batch;
size_t hidden_size;
size_t input_size;
@@ -54,15 +54,15 @@ namespace LayerTestsDefinitions {
float clip;
ngraph::op::RecurrentSequenceDirection direction;
InferenceEngine::Precision netPrecision;
std::tie(m_mode, seq_lenghts, batch, hidden_size, input_size, activations, clip, direction, netPrecision,
std::tie(m_mode, seq_lengths, batch, hidden_size, input_size, activations, clip, direction, netPrecision,
targetDevice) = this->GetParam();
size_t num_directions = direction == ngraph::op::RecurrentSequenceDirection::BIDIRECTIONAL ? 2 : 1;
std::vector<std::vector<size_t>> inputShapes = {
{{batch, seq_lenghts, input_size}, {batch, num_directions, hidden_size}, {batch},
{{batch, seq_lengths, input_size}, {batch, num_directions, hidden_size}, {batch},
{num_directions, hidden_size, input_size}, {num_directions, hidden_size, hidden_size},
{num_directions, hidden_size}},
};
m_max_seq_len = seq_lenghts;
m_max_seq_len = seq_lengths;
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {inputShapes[0], inputShapes[1]});
if (m_mode == SequenceTestsMode::CONVERT_TO_TI_MAX_SEQ_LEN_PARAM ||
@@ -9,7 +9,7 @@ namespace LayerTestsDefinitions {
std::string TensorIteratorTest::getTestCaseName(const testing::TestParamInfo<TensorIteratorParams> &obj) {
bool should_decompose;
size_t seq_lenghts;
size_t seq_lengths;
size_t batch;
size_t hidden_size;
size_t input_size = 10;
@@ -19,7 +19,7 @@ namespace LayerTestsDefinitions {
ngraph::op::RecurrentSequenceDirection direction;
InferenceEngine::Precision netPrecision;
std::string targetDevice;
std::tie(should_decompose, seq_lenghts, batch, hidden_size, sequence_axis, clip, ti_body, direction, netPrecision,
std::tie(should_decompose, seq_lengths, batch, hidden_size, sequence_axis, clip, ti_body, direction, netPrecision,
targetDevice) = obj.param;
std::vector<std::vector<size_t>> inputShapes = {};
@@ -44,7 +44,7 @@ namespace LayerTestsDefinitions {
std::ostringstream result;
result << "unrolling=" << should_decompose << "_";
result << "seq_len=" << seq_lenghts << "_";
result << "seq_len=" << seq_lengths << "_";
result << "seq_len_axis=" << sequence_axis << "_";
result << "batch=" << batch << "_";
result << "hidden_size=" << hidden_size << "_";
@@ -59,7 +59,7 @@ namespace LayerTestsDefinitions {
}
void TensorIteratorTest::SetUp() {
size_t seq_lenghts;
size_t seq_lengths;
bool should_decompose;
size_t batch;
size_t hidden_size;
@@ -69,7 +69,7 @@ namespace LayerTestsDefinitions {
float clip;
ngraph::op::RecurrentSequenceDirection direction;
InferenceEngine::Precision netPrecision;
std::tie(should_decompose, seq_lenghts, batch, hidden_size, sequence_axis, clip, ti_body, direction, netPrecision,
std::tie(should_decompose, seq_lengths, batch, hidden_size, sequence_axis, clip, ti_body, direction, netPrecision,
targetDevice) = this->GetParam();
std::vector<std::vector<size_t>> inputShapes;
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
@@ -84,7 +84,7 @@ namespace LayerTestsDefinitions {
switch (ti_body) {
case ngraph::helpers::TensorIteratorBody::LSTM: {
inputShapes = {
{{batch, seq_lenghts, input_size}, {batch, hidden_size}, {batch, hidden_size}, {4 * hidden_size, input_size},
{{batch, seq_lengths, input_size}, {batch, hidden_size}, {batch, hidden_size}, {4 * hidden_size, input_size},
{4 * hidden_size, hidden_size}, {4 * hidden_size}},
};
if (sequence_axis == 0) {
@@ -130,7 +130,7 @@ namespace LayerTestsDefinitions {
}
case ngraph::helpers::TensorIteratorBody::GRU: {
inputShapes = {
{{batch, seq_lenghts, input_size}, {batch, hidden_size}, {3 * hidden_size, input_size},
{{batch, seq_lengths, input_size}, {batch, hidden_size}, {3 * hidden_size, input_size},
{3 * hidden_size, hidden_size}, {3 * hidden_size}},
};
if (sequence_axis == 0) {
@@ -172,7 +172,7 @@ namespace LayerTestsDefinitions {
break;
}
case ngraph::helpers::TensorIteratorBody::RNN: {
inputShapes = {{batch, seq_lenghts, input_size},
inputShapes = {{batch, seq_lengths, input_size},
{batch, hidden_size},
{hidden_size, input_size},
{hidden_size, hidden_size},
@@ -209,7 +209,7 @@ void concat_in_place_optimization::optimize_cascade(concatenation_node& node, st
// apply concatenation in place optimization
for (auto input : node.get_dependencies()) {
auto input_lenght = input->get_output_layout().size.raw[concat_axis];
auto input_length = input->get_output_layout().size.raw[concat_axis];
if (input->is_type<concatenation>() && input->can_be_optimized())
need_reoptimization.push_back(&input->as<concatenation>());
@@ -218,7 +218,7 @@ void concat_in_place_optimization::optimize_cascade(concatenation_node& node, st
//
// |--- lower padd ---| |---------- upper padd -----------|
// |-- output padd ---| ----- input1 ------|----- input2 -----|-- out padd --|
upper_padd.raw[concat_axis] -= input_lenght;
upper_padd.raw[concat_axis] -= input_length;
// set new padding for input
input->set_output_padding(padding(lower_padd.sizes(), upper_padd.sizes()));
@@ -227,7 +227,7 @@ void concat_in_place_optimization::optimize_cascade(concatenation_node& node, st
//
// |-------------- lower padd -------------|---------- upper padd -----------|
// |-- output padd ---| ----- input1 ------|----- input2 -----|-- out padd --|
lower_padd.raw[concat_axis] += input_lenght;
lower_padd.raw[concat_axis] += input_length;
}
node.can_be_optimized(true);
@@ -31,20 +31,20 @@ TEST_F(MvncNoBootOpenDevice, OpenTwiceSameHandler) {
deviceDesc.platform = NC_ANY_PLATFORM;
char dev_addr_first_open[MAX_DEV_NAME];
unsigned int data_lenght_first = MAX_DEV_NAME;
unsigned int data_length_first = MAX_DEV_NAME;
char dev_addr_second_open[MAX_DEV_NAME];
unsigned int data_lenght_second = MAX_DEV_NAME;
unsigned int data_length_second = MAX_DEV_NAME;
// First open, get device name
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, watchdogInterval, firmwarePath));
ASSERT_NO_ERROR(ncDeviceGetOption(deviceHandle, NC_RO_DEVICE_NAME,
dev_addr_first_open, &data_lenght_first));
dev_addr_first_open, &data_length_first));
// Second open, get device name
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, watchdogInterval, firmwarePath));
ASSERT_NO_ERROR(ncDeviceGetOption(deviceHandle, NC_RO_DEVICE_NAME,
dev_addr_second_open, &data_lenght_second));
dev_addr_second_open, &data_length_second));
ASSERT_NO_ERROR(ncDeviceClose(&deviceHandle));
// Should be the same device
@@ -220,20 +220,20 @@ TEST_P(MvncOpenDevice, OpenTwiceSameHandler) {
deviceDesc.platform = NC_ANY_PLATFORM;
char dev_addr_first_open[MAX_DEV_NAME];
unsigned int data_lenght_first = MAX_DEV_NAME;
unsigned int data_length_first = MAX_DEV_NAME;
char dev_addr_second_open[MAX_DEV_NAME];
unsigned int data_lenght_second = MAX_DEV_NAME;
unsigned int data_length_second = MAX_DEV_NAME;
// First open, get device name
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, m_ncDeviceOpenParams));
ASSERT_NO_ERROR(ncDeviceGetOption(deviceHandle, NC_RO_DEVICE_NAME,
dev_addr_first_open, &data_lenght_first));
dev_addr_first_open, &data_length_first));
// Second open, get device name
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle, deviceDesc, m_ncDeviceOpenParams));
ASSERT_NO_ERROR(ncDeviceGetOption(deviceHandle, NC_RO_DEVICE_NAME,
dev_addr_second_open, &data_lenght_second));
dev_addr_second_open, &data_length_second));
ASSERT_NO_ERROR(ncDeviceClose(&deviceHandle, m_watchdogHndl));
// Should be the same device
@@ -113,7 +113,7 @@ TEST_F(MvncOpenUSBDevice, OpenAvailableDeviceByName) {
GTEST_SKIP();
char dev_addr_open[NC_MAX_NAME_SIZE];
unsigned int data_lenght = NC_MAX_NAME_SIZE;
unsigned int data_length = NC_MAX_NAME_SIZE;
auto availableDevices = getDevicesList();
@@ -122,7 +122,7 @@ TEST_F(MvncOpenUSBDevice, OpenAvailableDeviceByName) {
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle_, deviceDesc_, m_ncDeviceOpenParams));
ASSERT_NO_ERROR(ncDeviceGetOption(deviceHandle_, NC_RO_DEVICE_NAME,
dev_addr_open, &data_lenght));
dev_addr_open, &data_length));
ASSERT_TRUE(strncmp(dev_addr_open, deviceDesc_.name, NC_MAX_NAME_SIZE) == 0);
ASSERT_NO_ERROR(ncDeviceClose(&deviceHandle_, m_watchdogHndl));
@@ -147,10 +147,10 @@ TEST_F(MvncOpenUSBDevice, OpenTwiceSameHandlerByName) {
GTEST_SKIP();
char dev_addr_first_open[MAX_DEV_NAME];
unsigned int data_lenght_first = MAX_DEV_NAME;
unsigned int data_length_first = MAX_DEV_NAME;
char dev_addr_second_open[MAX_DEV_NAME];
unsigned int data_lenght_second = MAX_DEV_NAME;
unsigned int data_length_second = MAX_DEV_NAME;
auto availableDevices = getDevicesList();
@@ -159,12 +159,12 @@ TEST_F(MvncOpenUSBDevice, OpenTwiceSameHandlerByName) {
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle_, deviceDesc_, m_ncDeviceOpenParams));
ASSERT_NO_ERROR(ncDeviceGetOption(deviceHandle_, NC_RO_DEVICE_NAME,
dev_addr_first_open, &data_lenght_first));
dev_addr_first_open, &data_length_first));
// Second open, get device name
ASSERT_NO_ERROR(ncDeviceOpen(&deviceHandle_, deviceDesc_, m_ncDeviceOpenParams));
ASSERT_NO_ERROR(ncDeviceGetOption(deviceHandle_, NC_RO_DEVICE_NAME,
dev_addr_second_open, &data_lenght_second));
dev_addr_second_open, &data_length_second));
ASSERT_NO_ERROR(ncDeviceClose(&deviceHandle_, m_watchdogHndl));
// Should be the same device
+4 -4
View File
@@ -3953,9 +3953,9 @@ PUGI__NS_BEGIN
// skip ]] if we stopped at ]]>, > will go to the next CDATA section
if (*s) s += 2;
size_t bufLenght = static_cast<size_t>(s - prev);
size_t bufLength = static_cast<size_t>(s - prev);
writer.write_buffer(prev, bufLenght);
writer.write_buffer(prev, bufLength);
writer.write(']', ']', '>');
}
@@ -4013,9 +4013,9 @@ PUGI__NS_BEGIN
// look for -\0 or -- sequence - we can't output it since -- is illegal in comment body
while (*s && !(s[0] == '-' && (s[1] == '-' || s[1] == 0))) ++s;
size_t bufLenght = static_cast<size_t>(s - prev);
size_t bufLength = static_cast<size_t>(s - prev);
writer.write_buffer(prev, bufLenght);
writer.write_buffer(prev, bufLength);
if (*s)
{
+1 -1
View File
@@ -21,7 +21,7 @@ namespace ngraph
/// \brief Constructs a CTCLoss operation
///
/// \param logits 3-D tensor of logits
/// \param logit_length 1-D tensor of lenght for each object from
/// \param logit_length 1-D tensor of length for each object from
/// a batch
/// \param labels 2-D tensor of labels for which likelyhood
/// is estimated using logist
@@ -98,13 +98,13 @@ namespace ngraph
private:
///
/// \brief Gets the masked value according to sequence lenght in a batch.
/// \brief Gets the masked value according to sequence length in a batch.
///
/// \note Zeros out values or sets them to default value for inputs with
/// sequence lenght shorter than currently procssed time step.
/// sequence length shorter than currently procssed time step.
///
/// \param[in] data The input value.
/// \param[in] time_step The current time step denoting sequence lenght.
/// \param[in] time_step The current time step denoting sequence length.
/// \param[in] batch_axis The batch axis index of data tensor.
/// \param[in] default_value The default value for masked elements.
///
+1 -1
View File
@@ -54,7 +54,7 @@ namespace ngraph
/// value) or ignored (1 value)
///
/// \param[in] axes Axes input of ONNX Slice operator
/// \param[in] slice_indices_length Lenght of Slice indices
/// \param[in] slice_indices_length Length of Slice indices
/// (starts, ends, steps)
///
/// \return Mask attribute in format required by StridedSlice:v1
@@ -25,7 +25,7 @@ namespace ngraph
if (entry.key() == "offset")
m_offset = std::stoi(entry.value());
if (entry.key() == "length")
m_data_lenght = std::stoi(entry.value());
m_data_length = std::stoi(entry.value());
if (entry.key() == "checksum")
m_sha1_digest = std::stoi(entry.value());
}
@@ -43,11 +43,11 @@ namespace ngraph
if (external_data_stream.fail())
throw error::invalid_external_data{*this};
std::streamsize read_data_lenght;
if (m_data_lenght == 0) // read entire file
read_data_lenght = external_data_stream.tellg();
std::streamsize read_data_length;
if (m_data_length == 0) // read entire file
read_data_length = external_data_stream.tellg();
else
read_data_lenght = m_data_lenght;
read_data_length = m_data_length;
const auto page_size = 4096;
if (m_offset != 0 && m_offset % page_size != 0)
@@ -65,8 +65,8 @@ namespace ngraph
}
std::string read_data;
read_data.resize(read_data_lenght);
external_data_stream.read(&read_data[0], read_data_lenght);
read_data.resize(read_data_length);
external_data_stream.read(&read_data[0], read_data_length);
external_data_stream.close();
return read_data;
@@ -78,7 +78,7 @@ namespace ngraph
s << "ExternalDataInfo(";
s << "data_full_path: " << m_data_location;
s << ", offset: " << m_offset;
s << ", data_lenght: " << m_data_lenght;
s << ", data_length: " << m_data_length;
s << ", sha1_digest: " << m_sha1_digest << ")";
return s.str();
}
@@ -35,7 +35,7 @@ namespace ngraph
private:
std::string m_data_location{};
int m_offset = 0;
int m_data_lenght = 0;
int m_data_length = 0;
int m_sha1_digest = 0;
};
} // namespace detail
@@ -63,17 +63,17 @@ def test_reverse_sequence():
],
dtype=np.int32,
).reshape([2, 3, 4, 2])
seq_lenghts = np.array([1, 2, 1, 2], dtype=np.int32)
seq_lengths = np.array([1, 2, 1, 2], dtype=np.int32)
batch_axis = 2
sequence_axis = 1
input_param = ng.parameter(input_data.shape, name="input", dtype=np.int32)
seq_lengths_param = ng.parameter(seq_lenghts.shape, name="sequence lengths", dtype=np.int32)
seq_lengths_param = ng.parameter(seq_lengths.shape, name="sequence lengths", dtype=np.int32)
model = ng.reverse_sequence(input_param, seq_lengths_param, batch_axis, sequence_axis)
runtime = get_runtime()
computation = runtime.computation(model, input_param, seq_lengths_param)
result = computation(input_data, seq_lenghts)
result = computation(input_data, seq_lengths)
expected = np.array(
[
+8 -8
View File
@@ -44,8 +44,8 @@ NGRAPH_TEST(${BACKEND_NAME}, reverse_sequence_n2c3h4w2)
12, 0, 15, 0, 18, 0, 21, 0, 13, 0, 16, 0, 19, 0, 22, 0, 14, 0, 17, 0, 20, 0, 23, 0,
};
std::vector<int> seq_lenghts{1, 2, 1, 2};
copy_data(b, seq_lenghts);
std::vector<int> seq_lengths{1, 2, 1, 2};
copy_data(b, seq_lengths);
std::vector<int> expected{
0, 0, 4, 0, 6, 0, 10, 0, 1, 0, 3, 0, 7, 0, 9, 0, 2, 0, 5, 0, 8, 0, 11, 0,
@@ -81,8 +81,8 @@ NGRAPH_TEST(${BACKEND_NAME}, reverse_sequence_n4c3h2w2)
shared_ptr<runtime::Tensor> result = backend->create_tensor(element::i32, shape);
std::vector<int> seq_lenghts{1, 2, 3, 3};
copy_data(b, seq_lenghts);
std::vector<int> seq_lengths{1, 2, 3, 3};
copy_data(b, seq_lengths);
std::vector<int> input{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
@@ -137,8 +137,8 @@ NGRAPH_TEST(${BACKEND_NAME}, reverse_sequence_n4d2c3h2w2)
copy_data(a, input);
std::vector<int> seq_lenghts{1, 2, 1, 2};
copy_data(b, seq_lenghts);
std::vector<int> seq_lengths{1, 2, 1, 2};
copy_data(b, seq_lengths);
auto handle = backend->compile(f);
handle->call_with_validate({result}, {a, b});
@@ -171,8 +171,8 @@ NGRAPH_TEST(${BACKEND_NAME}, reverse_sequence_negative_axes)
12, 0, 15, 0, 18, 0, 21, 0, 13, 0, 16, 0, 19, 0, 22, 0, 14, 0, 17, 0, 20, 0, 23, 0,
};
std::vector<int> seq_lenghts{1, 2, 1, 2};
copy_data(b, seq_lenghts);
std::vector<int> seq_lengths{1, 2, 1, 2};
copy_data(b, seq_lengths);
std::vector<int> expected{
0, 0, 4, 0, 6, 0, 10, 0, 1, 0, 3, 0, 7, 0, 9, 0, 2, 0, 5, 0, 8, 0, 11, 0,
@@ -101,7 +101,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_external_invalid_external_data_exception)
{
EXPECT_PRED_FORMAT2(
testing::IsSubstring,
std::string("not_existed_file.data, offset: 4096, data_lenght: 16, sha1_digest: 0)"),
std::string("not_existed_file.data, offset: 4096, data_length: 16, sha1_digest: 0)"),
error.what());
}
catch (...)
@@ -123,7 +123,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_external_invalid_up_dir_path)
{
EXPECT_PRED_FORMAT2(testing::IsSubstring,
std::string("tensor.data, offset: 4096, "
"data_lenght: 16, sha1_digest: 0)"),
"data_length: 16, sha1_digest: 0)"),
error.what());
}
catch (...)
+7 -7
View File
@@ -12,13 +12,13 @@ using namespace ngraph;
TEST(type_prop, reverse_sequence_1_dim)
{
auto data = make_shared<op::Parameter>(element::f32, Shape{4, 3, 2});
auto seq_lenghts = make_shared<op::Parameter>(element::f32, Shape{4, 4});
auto seq_lengths = make_shared<op::Parameter>(element::f32, Shape{4, 4});
try
{
size_t batch_axis = 0;
size_t seq_axis = 1;
auto bc = make_shared<op::ReverseSequence>(data, seq_lenghts, batch_axis, seq_axis);
FAIL() << "ReverseSequence c-tor should throw for seq_lenghts whose rank isn't equal to 1";
auto bc = make_shared<op::ReverseSequence>(data, seq_lengths, batch_axis, seq_axis);
FAIL() << "ReverseSequence c-tor should throw for seq_lengths whose rank isn't equal to 1";
}
catch (const NodeValidationFailure& error)
{
@@ -34,12 +34,12 @@ TEST(type_prop, reverse_sequence_1_dim)
TEST(type_prop, reverse_sequence_batch_index_oob)
{
auto data = make_shared<op::Parameter>(element::f32, Shape{4, 3, 2});
auto seq_lenghts = make_shared<op::Parameter>(element::f32, Shape{3});
auto seq_lengths = make_shared<op::Parameter>(element::f32, Shape{3});
try
{
size_t batch_axis = 3;
size_t seq_axis = 1;
auto bc = make_shared<op::ReverseSequence>(data, seq_lenghts, batch_axis, seq_axis);
auto bc = make_shared<op::ReverseSequence>(data, seq_lengths, batch_axis, seq_axis);
FAIL() << "ReverseSequence c-tor should throw for out-of-bounds batch axis index";
}
catch (const ngraph_error& error)
@@ -76,12 +76,12 @@ TEST(type_prop, reverse_sequence_sequence_index_oob)
TEST(type_prop, reverse_sequence_seq_len_size_equal_to_batch_dim)
{
auto data = make_shared<op::Parameter>(element::f32, Shape{4, 3, 2});
auto seq_lenghts = make_shared<op::Parameter>(element::f32, Shape{3});
auto seq_lengths = make_shared<op::Parameter>(element::f32, Shape{3});
try
{
size_t batch_axis = 0;
size_t seq_axis = 1;
auto bc = make_shared<op::ReverseSequence>(data, seq_lenghts, batch_axis, seq_axis);
auto bc = make_shared<op::ReverseSequence>(data, seq_lengths, batch_axis, seq_axis);
FAIL() << "ReverseSequence c-tor should throw when sequence length size isn't equal to "
"batch dimension";
}