openvino
openvino copied to clipboard
[TF FE]: Support complex tensors for SegmentSum operations
Details:
- Edited Tests for Segment Sum
Resolves #23241
@rkazants I have updated the tests based on your review
Thanks, Adithya Hegde Kota
Hey @rkazants ,I'm not sure wether the variables names data_real
and data_imag
will be appropriate
build_jenkins
build_jenkins
build_jenkins
build_jenkins
@hegdeadithyak, please fix build issue. Check locally on your machine:
2024-04-14T19:50:03.8004298Z In file included from /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:25:
2024-04-14T19:50:03.8007871Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator.h:173:24: error: no matching constructor for initialization of 'ov::frontend::ComplexTypeMark'
2024-04-14T19:50:03.8010253Z 173 | ::new ((void*)__p) _Up(std::forward<_Args>(__args)...);
2024-04-14T19:50:03.8014720Z | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-04-14T19:50:03.8019961Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator_traits.h:296:9: note: in instantiation of function template specialization 'std::allocator<ov::frontend::ComplexTypeMark>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>>' requested here
2024-04-14T19:50:03.8023144Z 296 | __a.construct(__p, std::forward<_Args>(__args)...);
2024-04-14T19:50:03.8023987Z | ^
2024-04-14T19:50:03.8027455Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:265:33: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<ov::frontend::ComplexTypeMark>>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>, void>' requested here
@hegdeadithyak, please fix build issue. Check locally on your machine:
2024-04-14T19:50:03.8004298Z In file included from /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:25: 2024-04-14T19:50:03.8007871Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator.h:173:24: error: no matching constructor for initialization of 'ov::frontend::ComplexTypeMark' 2024-04-14T19:50:03.8010253Z 173 | ::new ((void*)__p) _Up(std::forward<_Args>(__args)...); 2024-04-14T19:50:03.8014720Z | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2024-04-14T19:50:03.8019961Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator_traits.h:296:9: note: in instantiation of function template specialization 'std::allocator<ov::frontend::ComplexTypeMark>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>>' requested here 2024-04-14T19:50:03.8023144Z 296 | __a.construct(__p, std::forward<_Args>(__args)...); 2024-04-14T19:50:03.8023987Z | ^ 2024-04-14T19:50:03.8027455Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:265:33: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<ov::frontend::ComplexTypeMark>>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>, void>' requested here
Hi @hegdeadithyak, please clarify - did you fix build issue?
@hegdeadithyak, please fix build issue. Check locally on your machine:
2024-04-14T19:50:03.8004298Z In file included from /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:25: 2024-04-14T19:50:03.8007871Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator.h:173:24: error: no matching constructor for initialization of 'ov::frontend::ComplexTypeMark' 2024-04-14T19:50:03.8010253Z 173 | ::new ((void*)__p) _Up(std::forward<_Args>(__args)...); 2024-04-14T19:50:03.8014720Z | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2024-04-14T19:50:03.8019961Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/allocator_traits.h:296:9: note: in instantiation of function template specialization 'std::allocator<ov::frontend::ComplexTypeMark>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>>' requested here 2024-04-14T19:50:03.8023144Z 296 | __a.construct(__p, std::forward<_Args>(__args)...); 2024-04-14T19:50:03.8023987Z | ^ 2024-04-14T19:50:03.8027455Z /emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:265:33: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<ov::frontend::ComplexTypeMark>>::construct<ov::frontend::ComplexTypeMark, ov::Output<Node>, void>' requested here
Hi @hegdeadithyak, please clarify - did you fix build issue?
No Not yet, I am unable to find solution ,I'm On it do you have some kinda solution?
@rkazants Hey I have fixed the build Issue , and built it on my local system it is perfectly working fine.The error was to add the complex part type for the Complex Mark Type.
Thanks Adithya Hegde
build_jenkins
@hegdeadithyak, please fix code-style issues and test failure:
E TypeError: TestSegmentSumComplex.create_segment_sum_net() got an unexpected keyword argument 'data_type'
install\tests\layer_tests\tensorflow_tests\test_tf_SegmentSum.py:123: TypeError
_ TestSegmentSumComplex.test_segment_sum[ ie_device:CPU - precision:FP16 - params:{'data_shape': [4, 2, 1], 'segment_ids_shape': [4], 'data_type': <class 'numpy.float32'>, 'segment_ids_type': <class 'numpy.int32'>} ] _
[gw2] win32 -- Python 3.11.9 C:\actions-runner\_work\_tool\Python\3.11.9\x64\python3.exe
self = <test_tf_SegmentSum.TestSegmentSumComplex object at 0x000001F742301950>
params = {'data_shape': [4, 2, 1], 'data_type': <class 'numpy.float32'>, 'segment_ids_shape': [4], 'segment_ids_type': <class 'numpy.int32'>}
ie_device = 'CPU', precision = 'FP16', ir_version = 11
temp_dir = 'C:\\actions-runner\\_work\\openvino\\openvino\\install\\tests\\layer_tests\\common\\out\\CPU_test_segment_sum00nav1gn'
use_legacy_frontend = False
@pytest.mark.parametrize("params", test_data_basic)
@pytest.mark.precommit
@pytest.mark.nightly
def test_segment_sum(self, params, ie_device, precision, ir_version, temp_dir,
use_legacy_frontend):
if use_legacy_frontend:
pytest.skip("SegmentSum operation is not supported via legacy frontend.")
> self._test(*self.create_segment_sum_net(**params),
ie_device, precision, ir_version, temp_dir=temp_dir,
use_legacy_frontend=use_legacy_frontend)
E TypeError: TestSegmentSumComplex.create_segment_sum_net() got an unexpected keyword argument 'data_type'
install\tests\layer_tests\tensorflow_tests\test_tf_SegmentSum.py:[123](https://github.com/openvinotoolkit/openvino/actions/runs/8889542927/job/24409518498?pr=23676#step:15:124): TypeError
============================== warnings summary ===============================
install\tests\layer_tests\common\utils\tf_utils.py:42
C:\actions-runner\_work\openvino\openvino\install\tests\layer_tests\common\utils\tf_utils.py:42: DeprecationWarning: invalid escape sequence '\.'
restorer.restore(sess, re.sub('\.meta$', '', model_file))
build_jenkins
build_jenkins
build_jenkins
build_jenkins