!3774 Sync device data type to return tensor

Merge pull request !3774 from JoyLvliang/sync-device-data-type-to-return-tensor
This commit is contained in:
mindspore-ci-bot 2020-08-03 14:48:09 +08:00 committed by Gitee
commit fa96dfd161
1 changed files with 4 additions and 1 deletions

View File

@ -86,7 +86,10 @@ BaseRef CreateOneTensor(const AnfNodePtr &node, size_t output_index, const Kerne
MS_EXCEPTION_IF_NULL(address);
auto shape = AnfAlgo::GetOutputInferShape(node, output_index);
TypeId type_id = kNumberTypeFloat32;
type_id = AnfAlgo::GetOutputInferDataType(node, output_index);
type_id = AnfAlgo::GetOutputDeviceDataType(node, output_index);
if (type_id == kTypeUnknown) {
type_id = AnfAlgo::GetOutputInferDataType(node, output_index);
}
std::vector<int> temp_shape;
if (graph.IsInternalOutput(node, output_index)) {
temp_shape.emplace_back(1);