Browse Source

!24920 Bug in RandomData

Merge pull request !24920 from h.farahat/rand_data_bug
tags/v1.6.0
i-robot Gitee 4 years ago
parent
commit
1825d42b01
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.cc

+ 5
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/source/random_data_op.cc View File

@@ -159,7 +159,11 @@ Status RandomDataOp::ComputeColMap() {

Status RandomDataOp::LoadTensorRow(row_id_type row_id, TensorRow *row) {
CHECK_FAIL_RETURN_UNEXPECTED(row_id < total_rows_, "Wrong index.");
*row = rows_[row_id];
for (const auto &tensor : rows_[row_id]) {
TensorPtr new_tensor;
RETURN_IF_NOT_OK(Tensor::CreateFromTensor(tensor, &new_tensor));
row->emplace_back(new_tensor);
}
return Status::OK();
}



Loading…
Cancel
Save