Fixed fuzzer issues (#4553)
* Fixed code style * Revert redundant code * Fixed fuzzer issues
This commit is contained in:
1 parent
d4c5cb2375
commit
77e80ddbb3
10 files changed
+9
-124
No files matched your search
@@ -351,6 +351,8 @@ namespace ngraph
|
||||
std::vector<T> get_vector() const
|
||||
{
|
||||
const T* p = get_data_ptr<T>();
|
||||
if (p == nullptr)
|
||||
throw std::runtime_error("Cannot create vector! Buffer is not allocated.");
|
||||
return std::vector<T>(p, p + shape_size(m_shape));
|
||||
}
|
||||
|
||||
|
||||
@@ -53,10 +53,11 @@ void op::Squeeze::pre_validate_and_infer_types()
|
||||
bool data_has_dynamic_shape = data.get_partial_shape().is_dynamic();
|
||||
|
||||
auto axes_constant = get_constant_from_source(axes_node);
|
||||
bool axes_is_empty_constant =
|
||||
(axes_constant) ? axes_constant->cast_vector<int64_t>().empty() : false;
|
||||
bool axes_is_empty_constant = (axes_constant && axes_constant->get_data_ptr() != nullptr)
|
||||
? axes_constant->cast_vector<int64_t>().empty()
|
||||
: false;
|
||||
|
||||
if (data_has_dynamic_rank || !axes_constant ||
|
||||
if (data_has_dynamic_rank || !axes_constant || !axes_constant->get_data_ptr() ||
|
||||
(data_has_dynamic_shape && axes_is_empty_constant))
|
||||
{
|
||||
set_output_type(0, get_input_element_type(0), PartialShape::dynamic());
|
||||
|
||||
Reference in new issue
Block a user