Browse Source

setitem debug

tags/v1.2.0-rc1
yepei6 4 years ago
parent
commit
9fc721d1d2
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      mindspore/ops/composite/multitype_ops/_compile_utils.py

+ 3
- 4
mindspore/ops/composite/multitype_ops/_compile_utils.py View File

@@ -423,10 +423,9 @@ def _tensor_setitem_by_bool_tensor_with_scalar(data, index, value):

def _tensor_setitem_by_int_tensor_with_scalar(data, index, value):
"""Set a tensor item by a int tensor with a scalar."""
updates = _generate_updates_from_scalar(data, index, value,
const_utils.SET_ITEM_BY_ONE_TENSOR)
index = F.expand_dims(index, -1)
return P.TensorScatterUpdate()(data, index, updates)
index = F.expand_dims(index, 0)
updates = _generate_updates_from_scalar(data, index, value, const_utils.SET_ITEM_BY_ONE_TENSOR)
return P.ScatterUpdate()(data, index, updates)


def tensor_setitem_by_tensor_with_number(data, index, value):


Loading…
Cancel
Save