在python中,我可以实例化一个参差不齐的张量占位符,如下所示。
inputs_1 = keras.Input(shape=[None,], dtype='int64', ragged=True, name = 'message_A')
inputs_1
tf.RaggedTensor(values=Tensor("Placeholder:0", shape=(None,), dtype=int64), row_splits=Tensor("Placeholder_1:0", shape=(None,), dtype=int64))
Tensorflow responds that the placeholder is ragged with a shape=(None,). But using R-Keras & R-Tensorflow its seems I cannot do the same. I can request an input placeholder and the parameter to make it ragged exists but the response suggests it is not in fact ragged. Additionally, you are forced to declare some shape rather than keep the shape 'flexible' for the ragged tensor.
inputs_1 = tf$keras$Input(shape=c(100L), ragged = TRUE)
inputs_1
Tensor("Placeholder:0", shape=(None, 100), dtype=float32)
您能告诉我如何使用R-Keras或R-Tensorflow创建参差不齐的张量占位符吗?