Skip to content

Commit a69d8f5

Browse files
committed
added flatten layer
1 parent f0c144e commit a69d8f5

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import numpy as np
2+
3+
# Example input tensor with shape (2, 2, 3)
4+
input_tensor = np.array([
5+
[[1, 2, 3], [4, 5, 6]],
6+
[[7, 8, 9], [10, 11, 12]]
7+
])
8+
9+
# Flatten the tensor
10+
flattened_vector = input_tensor.flatten()
11+
12+
print("Input Tensor Shape:", input_tensor.shape)
13+
print("Input Tensor:\n", input_tensor)
14+
print("Flattened Vector Shape:", flattened_vector.shape)
15+
print("Flattened Vector:\n", flattened_vector)
16+

0 commit comments

Comments
 (0)