Thanks @ptrblck  for replying.
If i use below function instead of class it will also works?

def conv2d():
conv2d = nn.Sequential(nn.Conv2d(in_channels,out_channels,**kwargs)
,nn.BatchNorm2d(out_channels,eps = .001)
,nn.ReLU()
,nn.Dropout(0.15))
return conv2d