Skip to content

Commit

Permalink
if mxlen == 0, nothing to transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
Randall C. O'Reilly committed Aug 21, 2020
1 parent 9d9334e commit 8485fe9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions empi/tensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ func GatherTensorRowsString(dest, src *etensor.String, comm *mpi.Comm) error {
for _, l := range dln {
mxlen = ints.MaxInt(mxlen, l)
}
if mxlen == 0 {
return nil // nothing to transfer
}
sdt := make([]byte, ssz*mxlen)
ddt := make([]byte, dsz*mxlen)
idx := 0
Expand Down

0 comments on commit 8485fe9

Please sign in to comment.