forked from mindspore-Ecosystem/mindspore
!17745 Dataset kernel support scalar
From: @wilfchen Reviewed-by: @cristoval,@limingqi107 Signed-off-by: @limingqi107
This commit is contained in:
commit
e6c16a185d
|
@ -77,6 +77,10 @@ void GetShapeAndType(const CNodePtr &kernel_node, std::vector<std::vector<int>>
|
|||
std::vector<int> shape;
|
||||
(void)std::transform(values.begin(), values.end(), std::back_inserter(shape),
|
||||
[](const int64_t &value) { return static_cast<int>(value); });
|
||||
// Empty means scalar. Push one elements for bytes calculation.
|
||||
if (shape.empty()) {
|
||||
shape.push_back(1);
|
||||
}
|
||||
return shape;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue