首页 > 解决方案 > Tensorflow 和 python numpy:如何将张量/列表与特定索引连接起来

问题描述

我是Tensorflow 的作者:how to concat tensor with specific index

今天我想连接这两个列表

tensor_a = [[[[255,255,255]]], [[[100,100,100]]]]
tensor_b = [[[[0.1,0.2]]], [[[0.3,0.4]]]]

变成这样的格式

tensor_d = [[[[[255,255,255],[0.1,0.2]]]], [[[[100,100,100], [0.3,0.4]]]]]

我需要做这个转换:

  1. 使用 tensorflow(所以 tensor_a 和 tensor_b 是张量)

  2. 使用 list/numpy (所以 tensor_a 和 tensor_b 是列表)

我能怎么做?

标签: pythonlistnumpytensorflowdeep-learning

解决方案


推荐阅读