nn::Functional will be deprecated in the future because we now provide most functionals in module form as well (same as the Python API). For example:

nn::Functional(relu)

can be replaced by

nn::ReLU()

and

nn::Functional(max_pool2d, nn::MaxPool2dOptions(ExpandingArray<2>({2,2})))

can be replaced by

nn::MaxPool2d(nn::MaxPool2dOptions({2,2}))