>>> expressions = {
...   'expression_01': lambda x: 2*x,
...   'expression_02': lambda x: 3**x,
...   'expression_03': lambda x: 3*x**2 - 5}
>>> 
>>> import torch
>>> import torch.nn as nn
>>> class F(nn.Module):
...   def __init__(self, expression):
...     super(F, self).__init__()
...     self.expression = expression
...   def forward(self, x):
...     return self.expression(x)
...
>>> a = torch.DoubleTensor([4]) 
>>> f = F(expressions['expression_01'])
>>> f(a)
tensor([8.], dtype=torch.float64)
>>> f = F(expressions['expression_02'])
>>> f(a)
tensor([81.], dtype=torch.float64)
>>> f = F(expressions['expression_03'])
>>> f(a)
tensor([43.], dtype=torch.float64)