【发布时间】:2022-12-26 13:56:20
【问题描述】:
I have a batch of data with shape [?, dim],
x=[[ 0, 1, 2, 3, 4],
[ 5, 6, 7, 8, 9],
[10, 11, 12, 13, 14],
[15, 16, 17, 18, 19],
[20, 21, 22, 23, 24]]
and a tensor indicates repetition number for each row with shape [?,1], say:
rep_nums=[[1],[2],[1],[3],[1]]
and expecting result to be :
[[ 0, 1, 2, 3, 4],
[ 5, 6, 7, 8, 9],
[ 5, 6, 7, 8, 9],
[10, 11, 12, 13, 14],
[15, 16, 17, 18, 19],
[15, 16, 17, 18, 19],
[15, 16, 17, 18, 19],
[20, 21, 22, 23, 24]]
I tried dynamic_partition as this mentioned, but only works in TF2.x, which not compatible my pre-exist project.
【问题讨论】:
标签: tensorflow