The code that you have shared does not belong to the editable part of the notebook. That is, it shouldn’t be edited.
It should be :
style_scale = self.style_scale_transform(w)[:, :, None, None]
style_shift = self.style_shift_transform(w)[:, :, None, None]
Please do not modify the other part of the notebook which doesn’t belong to the editable part.
Moreover, w.shape will be a tuple which cannot be used as an index (the code itself doesn’t give any meaning as such).
Hope this solves your problem. Have a good day!
Regards,
Nithin
Hi Muhammad!
I’m afraid that the solution you have provided might be misleading because of the following reasons
This will give the shape of style_scale as (number of samples, image channels) :: ndim 2. Without giving out many details about the code :: the next step in the logic requires us to multiply (element-wise) style_scale with normalized image whose ndim is 4.(I don’t want reveal any more details on this as this belongs to the learner’s implementation part).
Plus, this portion of the code does not belong to the editable part. They have given the correct code already in the notebook. (i.e.)
style_scale = self.style_scale_transform(w)[:, :, None, None]
style_shift = self.style_shift_transform(w)[:, :, None, None]
Hence I request you, to delete your post so that we don’t confuse Wei.
Thank you.
Regards,
Nithin