data sync before get tensor value
This commit is contained in:
parent
3797dad108
commit
ece00fff3a
|
@ -208,6 +208,9 @@ int64_t GetIntValue(const NodePtr &node) { return AnfUtils::GetIntValue(node->ge
|
|||
std::vector<int64_t> GetIntList(const ValuePtr &value) {
|
||||
MS_EXCEPTION_IF_NULL(value);
|
||||
if (value->isa<tensor::Tensor>()) {
|
||||
auto tensor = value->cast<tensor::TensorPtr>();
|
||||
MS_EXCEPTION_IF_NULL(tensor);
|
||||
tensor->data_sync();
|
||||
return CheckAndConvertUtils::CheckTensorIntValue("tensor", value, "bprop");
|
||||
} else {
|
||||
return CheckAndConvertUtils::CheckIntOrTupleInt("value", value, "bprop");
|
||||
|
|
Loading…
Reference in New Issue