@@ -62,13 +62,13 @@ ov::SoPtr<ov::IRemoteTensor> RemoteContextImpl::create_tensor(const ov::element:
62
62
}
63
63
64
64
// Merge local remote properties with global remote properties.
65
- if (!mem_type_object.has_value ()) {
65
+ if (!mem_type_object.has_value () && _mem_type_object. has_value () ) {
66
66
mem_type_object = _mem_type_object;
67
67
}
68
- if (!tensor_type_object.has_value ()) {
68
+ if (!tensor_type_object.has_value () && _tensor_type_object. has_value () ) {
69
69
tensor_type_object = _tensor_type_object;
70
70
}
71
- if (!mem_handle_object.has_value ()) {
71
+ if (!mem_handle_object.has_value () && _mem_handle_object. has_value () ) {
72
72
mem_handle_object = _mem_handle_object;
73
73
}
74
74
@@ -82,27 +82,25 @@ ov::SoPtr<ov::IRemoteTensor> RemoteContextImpl::create_tensor(const ov::element:
82
82
}
83
83
84
84
// Mem_handle shall be set if mem_type is a shared memory type.
85
- if (* mem_type_object == MemType::SHARED_BUF && !mem_handle_object.has_value ()) {
85
+ if (mem_type_object. value () == MemType::SHARED_BUF && !mem_handle_object.has_value ()) {
86
86
OPENVINO_THROW (" No parameter " , mem_handle.name (), " found in parameters map" );
87
87
}
88
88
89
- return _device->createRemoteTensor (
90
- get_this_shared_ptr (),
91
- type,
92
- shape,
93
- _config,
94
- tensor_type_object.has_value () ? *tensor_type_object : ov::intel_npu::TensorType::BINDED,
95
- *mem_type_object,
96
- *mem_handle_object);
89
+ return _device->createRemoteTensor (get_this_shared_ptr (),
90
+ type,
91
+ shape,
92
+ _config,
93
+ tensor_type_object.value_or (ov::intel_npu::TensorType::BINDED),
94
+ mem_type_object.value_or (ov::intel_npu::MemType::L0_INTERNAL_BUF),
95
+ mem_handle_object.value_or (nullptr ));
97
96
}
98
97
99
98
ov::SoPtr<ov::ITensor> RemoteContextImpl::create_host_tensor (const ov::element::Type type, const ov::Shape& shape) {
100
- return _device->createHostTensor (
101
- get_this_shared_ptr (),
102
- type,
103
- shape,
104
- _config,
105
- _tensor_type_object.has_value () ? *_tensor_type_object : ov::intel_npu::TensorType::BINDED);
99
+ return _device->createHostTensor (get_this_shared_ptr (),
100
+ type,
101
+ shape,
102
+ _config,
103
+ _tensor_type_object.value_or (ov::intel_npu::TensorType::BINDED));
106
104
}
107
105
108
106
const std::string& RemoteContextImpl::get_device_name () const {
0 commit comments