Skip to content

Commit

Permalink
Merge pull request openvinotoolkit#54 from almilosz/update-output
Browse files Browse the repository at this point in the history
Remove Output setNames and addNames
  • Loading branch information
almilosz authored Oct 13, 2023
2 parents 854b9e2 + 7798b78 commit 98e6368
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 43 deletions.
4 changes: 0 additions & 4 deletions src/bindings/js/node/include/node_output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ class Output<ov::Node> : public Napi::ObjectWrap<Output<ov::Node>> {

Napi::Value get_any_name(const Napi::CallbackInfo& info);

void set_names(const Napi::CallbackInfo& info);

void add_names(const Napi::CallbackInfo& info);

private:
ov::Output<ov::Node> _output;
};
Expand Down
2 changes: 0 additions & 2 deletions src/bindings/js/node/lib/addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ interface Output {
getAnyName(): string;
getShape(): number[];
getPartialShape(): number[];
setNames(names: string[]): void;
getNames(): string[];
}

interface PrePostProcessor {
Expand Down
12 changes: 0 additions & 12 deletions src/bindings/js/node/src/node_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ Napi::Function Output<ov::Node>::GetClassConstructor(Napi::Env env) {
Output<ov::Node>::InstanceMethod("getPartialShape", &Output<ov::Node>::get_partial_shape),
Output<ov::Node>::InstanceMethod("getAnyName", &Output<ov::Node>::get_any_name),
Output<ov::Node>::InstanceAccessor<&Output<ov::Node>::get_any_name>("anyName"),
Output<ov::Node>::InstanceMethod("setNames", &Output<ov::Node>::set_names),
Output<ov::Node>::InstanceMethod("addNames", &Output<ov::Node>::add_names),
Output<ov::Node>::InstanceMethod("toString", &Output<ov::Node>::get_any_name)});
}

Expand Down Expand Up @@ -56,16 +54,6 @@ Napi::Value Output<ov::Node>::get_any_name(const Napi::CallbackInfo& info) {
return Napi::String::New(info.Env(), _output.get_any_name());
}

void Output<ov::Node>::set_names(const Napi::CallbackInfo& info) {
auto names = js_to_cpp<std::unordered_set<std::string>>(info, 0, {js_array});
_output.set_names(names);
}

void Output<ov::Node>::add_names(const Napi::CallbackInfo& info) {
auto names = js_to_cpp<std::unordered_set<std::string>>(info, 0, {js_array});
_output.add_names(names);
}

Output<const ov::Node>::Output(const Napi::CallbackInfo& info) : Napi::ObjectWrap<Output<const ov::Node>>(info) {}

Napi::Function Output<const ov::Node>::GetClassConstructor(Napi::Env env) {
Expand Down
25 changes: 0 additions & 25 deletions src/bindings/js/node/tests/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,10 @@ describe('Output class', () => {
});
});

it('Ouput<ov::Node>.setNames() method', () => {
model.output().setNames(['bTestName', 'cTestName']);
assert.strictEqual(model.output().getAnyName(), 'bTestName');
assert.strictEqual(model.output().anyName, 'bTestName');
});

it('Ouput<ov::Node>.addNames() method', () => {
model.output().addNames(['aTestName']);
assert.strictEqual(model.output().getAnyName(), 'aTestName');
assert.strictEqual(model.output().anyName, 'aTestName');
});

it('Ouput<const ov::Node>.setNames() method', () => {
assert.throws(
() => compiledModel.output().setNames(['bTestName', 'cTestName'])
);
});

it('Ouput<const ov::Node>.addNames() method', () => {
assert.throws(
() => compiledModel.output().addNames(['aTestName']),
);
});

});

describe('Input class for ov::Input<const ov::Node>', () => {
it('CompiledModel.input() method', () => {
// TO_DO check if object is an instance of a value/class
assert.strictEqual(typeof compiledModel.input(), 'object');
});

Expand Down

0 comments on commit 98e6368

Please sign in to comment.