Mona_Jalal:

For example, I want to print layers[0] information but nothing gets printed.


What do you mean by “nothing gets printed”? If you add the line
print("Hi")

at the place where you were trying to print layers[0], does it print anything? (It should …)
To know the dimensions that go into the layer you added, you can try something like this:
x = self.layer1(x) ## the code existed before
print("The input shape is: " + str(x.shape))
x = self.layer_attend1(x)*x ## I added this code
x = self.layer2(x) ## the code existed before