合并Tensor: concat([tensor1, tensor2], div, name='concat')

Tensorflow Tensor合并与拆分

数组d和b都是3*2*1的三维数组,根据指定的维数合并,将对应维上的两个数组进行拼接。


拆分Tensor: dynamic_partition(data, partitions, num_partition, name=None)

参数data为即将被拆分的Tensor,partitions为拆分指定的Index,对于上述合成的tensor conc进行拆分

Tensorflow Tensor合并与拆分


定义了两组数组,维度为3*2*1,与我们之前合并Tensor时的两个数组维度相同。新定义的两个数组的值:一个全2为0,一个全为1,然后合并新数组作为dynamic_partition函数的参数partitions。运行Session后生成两个array,从两个array的生成顺序可以看到,第一个array为partitions中值为1的数组对应位置在合并数组conc中的值,第二个array为partitions中值为0的数组对应位置在合并数组conc中的值。

Tensorflow中文社区提供的展示:Tensorflow Tensor合并与拆分


相关文章:

  • 2021-12-03
  • 2022-01-28
  • 2021-11-16
  • 2021-04-14
  • 2021-04-24
  • 2022-12-23
猜你喜欢
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-01-16
相关资源
相似解决方案