Created
October 6, 2020 08:42
-
-
Save mgnisia/b1bc47fe797df6b4310746953a70d059 to your computer and use it in GitHub Desktop.
Printing of three dimensional tensor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assumption tensor == np.array | |
def print_tensor(tensor): | |
for i3 in range(0, tensor.shape[0]): | |
for i1 in range(0, tensor.shape[2]): | |
string_line = "" | |
for i2 in range(0, tensor.shape[1]): | |
string_line += " {:3.2f} ".format(tensor[i3][i2][i1]) | |
print(string_line) | |
print("------------------------------------") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment