I made simple dataset like below.
x_data = [[0, 0],
[0, 1],
[1, 0],
[1, 1]]
y_data = [[0],
[1],
[1],
[0]]
And I slice it by using from_tensor_slices:
(I don't know exact role of tensor slice function...)
dataset = tf.data.Dataset.from_tensor_slices((x_data, y_data)).batch(len(x_data))
when I print dataset using print function, it shows like below:
<BatchDataset shapes: ((None, 2), (None, 1)), types: (tf.int32, tf.int32)>
and when I print it using for loop it show like below:
tf.Tensor(
[[0 0]
[0 1]
[1 0]
[1 1]], shape=(4, 2), dtype=int32)
tf.Tensor(
[[0]
[1]
[1]
[0]], shape=(4, 1), dtype=int32)
Here is question:
In my idea, tensor shape should be (4,2) and (4,1) because row of matrix is 4.
Why when I use print, it shows (None,2) and (None,1)?
And how to print value of tensor without for loop?