Set the shape to the specified value if the current assignment is empty. * * @param[in,out] info Tensor info used to check and assign. * @param[in] shape New shape. * * @return True if the shape has been changed. */
| 93 | * @return True if the shape has been changed. |
| 94 | */ |
| 95 | inline bool set_shape_if_empty(ITensorInfo &info, const TensorShape &shape) |
| 96 | { |
| 97 | if (info.tensor_shape().total_size() == 0) |
| 98 | { |
| 99 | info.set_tensor_shape(shape); |
| 100 | return true; |
| 101 | } |
| 102 | |
| 103 | return false; |
| 104 | } |
| 105 | |
| 106 | /** Set the format, data type and number of channels to the specified value if |
| 107 | * the current data type is unknown. |
no test coverage detected