如何将可变形状的张量输入到估计器中

时间:2018-03-24 15:53:56

标签: tensorflow tensorflow-datasets tensorflow-estimator

我有兴趣研究tensorflow中的图形。节点数量因数据集中的图形而异。这是有问题的,因为在我的观察中,张量流不容易让我输入具有可变形状的数据。

更具体地说,当数组的形状不同时,是否有人可以建议一种简单的方法将批量的2d数组提供给if (params.id) { this.productid = params['id']; // << no underscore for the id! this.getProducts(this.productid); // << get products by productId not by userId } ?我一直在使用tf.Estimator.estimator来获取固定大小的数据集,但我现在需要一种不同的方法。

1 个答案:

答案 0 :(得分:0)

为此目的引入了参差不齐的张量。

https://www.tensorflow.org/guide/ragged_tensor