-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Update Part1_TensorFlow.ipynb #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
row_vector = matrix[1] column_vector = matrix[:,2] scalar = matrix[1, 2] You cant acces third dimension (2) in a 2x2 matrix
matrix
is actually defined by yourself in previous cell, just code it bigger than 2
nightcap1979
commented
Aug 3, 2021
marius190 is right, the following has to replace the current code:
row_vector = matrix[0]
column_vector = matrix[:,1]
scalar = matrix[0, 1]
datasith
commented
May 16, 2022
Technically, @alaneuler is right. The description uses the term "dimensions" which in this context is interchangeable with "axes" or "rank" (see TensorFlow's documentation). Whether this was intentional or not, a solution could be to define a 2xn
matrix with n>=3
. I do agree that it would be more appropriate to choose indexes like those @nightcap1979 proposed such that it works for all tensors with 2 axes.
row_vector = matrix[1]
column_vector = matrix[:,2]
scalar = matrix[1, 2]
You cant acces third dimension (2) in a 2x2 matrix