On approach would be to freeze all parameters in the original layer and create some_random_tensor as a new nn.Parameter.
The original module and the new parameter could be initialized in a custom nn.Module and in its forward method you could use the functional API (e.g. via F.linear) and apply your operation.