I want to change this Keras function into PyTorch. Should I rewrite a new function or there is a function that Pytorch had already exist? Thanks
Which function would you like to convert from Keras to PyTorch?
I want to find a function that has multiple inputs. For examples: my code has 4 inputs(batch, input height, input weight, and input channel)
I don’t want to redefine a lot of function, and trying to make my code easier to read.
Thanks for reply!
If you want to grab the dimension shapes, you could use:
size = my_tensor.size()
N, C, H, W = my_tensor.size()
.shape should also work.