fluid.layers.split 的使用方法 && 训练过程中传入list数组
Created by: aprilvkuo
问题一: split使用方法
报错信息: 我想对第一维进行split操作, 将输入向量拆分成几个list。 但是因为第一维是-1, split操作操作报错信息如下。
(-1, 128)
(-1, 1)
Traceback (most recent call last):
File "main.py", line 102, in <module>
out = model.forward(x, y, split_list)
File "main.py", line 33, in forward
sample_per_class_embs = fluid.layers.split(x, num_or_sections=split_list, dim=0) # 每一个类别的向量
File "/home/work/guohongjie/miniconda3/lib/python3.6/site-packages/paddle/fluid/layers/nn.py", line 5035, in split
dim], 'len(num_or_sections) must not be more than input.shape[dim].'
AssertionError: len(num_or_sections) must not be more than input.shape[dim].
问题2: 我在训练过程中, 每个step想要传入一个list数组, 不知道paddle是否支持
- 是否feed必须通过feed方式
- feed方式是否支持,数据流程是否为( list ->feed ->variable -> list)