I have defined a function outside a class in Pytorch but the function has been called inside the constructor  and forward() of the class something like:

import torch
import torch.nn as nn

def func1(a):
    ## Body of the func
    return 

def func2(b,c):
   ## Body of the func
    return

class Something(nn.Module):
    def __init__(self,a):
        super().__init__()
        self.something = func1(a)

    def forward(self,a,b):
        x = func2(a,b)

Is the above code valid? I mean will the weights be updated during training?