[Solved] Two variables with the same value in Python

[ad_1]

No, it’s called unpacking (look it up, it’s common in python)

It’s shorthand for

W_grad = grad_fn(X_train,y_train,W,b)[0]
b_grad = grad_fn(X_train,y_train,W,b)[1]

It will only work if grad_fn(...) returns an iterable with two elements, otherwise it will fail.

[ad_2]

solved Two variables with the same value in Python