Browse Source

!31456 Support float immediate.

Merge pull request !31456 from gaoyong10/dynamic_shape_03
r1.7
i-robot Gitee 4 years ago
parent
commit
83b51f8f5e
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      mindspore/ccsrc/runtime/graph_scheduler/actor/data_prepare_actor.cc

+ 3
- 0
mindspore/ccsrc/runtime/graph_scheduler/actor/data_prepare_actor.cc View File

@@ -149,6 +149,9 @@ void PrepareDataForValue(const ValuePtr &value, const KernelWithIndex &node_with
} else if (value->isa<Int32Imm>()) {
type = kNumberTypeInt32;
(reinterpret_cast<int32_t *>(host_addr.get()))[0] = GetValue<int32_t>(value);
} else if (value->isa<FloatImm>()) {
type = kNumberTypeFloat;
(reinterpret_cast<float *>(host_addr.get()))[0] = GetValue<float>(value);
} else if (value->isa<Monad>()) {
return;
} else {


Loading…
Cancel
Save