forked from mindspore-Ecosystem/mindspore
!48446 Fix the Histogram exception, that is, when the input data is null Tensor, resulting in an error Segmentation fault
Merge pull request !48446 from 刘勇琪/master
This commit is contained in:
commit
8943349d2e
|
@ -81,6 +81,9 @@ bool HistogramCPUKernelMod::Launch(const std::vector<AddressPtr> &inputs, const
|
|||
template <typename T, typename InterType>
|
||||
void HistogramCPUKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs,
|
||||
const std::vector<AddressPtr> &outputs) {
|
||||
if (inputs[kIndex0]->size == 0) {
|
||||
return;
|
||||
}
|
||||
auto x_data = reinterpret_cast<T *>(inputs[kIndex0]->addr);
|
||||
auto y_data = reinterpret_cast<int32_t *>(outputs[kIndex0]->addr);
|
||||
size_t x_num = inputs[kIndex0]->size / sizeof(T);
|
||||
|
|
Loading…
Reference in New Issue