10#ifndef COLVARCOMP_TORCH_H
11#define COLVARCOMP_TORCH_H
18#include "colvarcomp.h"
23#include <torch/torch.h>
24#include <torch/script.h>
30 torch::jit::script::Module nn;
32 size_t m_output_index;
33 bool use_double_input;
36 torch::Tensor input_tensor;
37 torch::Tensor nn_outputs;
38 torch::Tensor input_grad;
40 std::vector<int> cvc_indices;
44 virtual int init(std::string
const &conf);
58 virtual int init(std::string
const &conf);
Colvar component (base class for collective variables)
Definition: colvarcomp.h:70
virtual void calc_gradients()
Calculate the atomic gradients, to be reused later in order to apply forces.
Definition: colvarcomp.h:141
virtual void apply_force(colvarvalue const &cvforce)
Apply the collective variable force, by communicating the atomic forces to the simulation program (No...
Definition: colvarcomp.cpp:544
Current only linear combination of sub-CVCs is available.
Definition: colvarcomp.h:1311
Definition: colvarcomp_torchann.h:54
virtual void calc_value()
Calculate the variable.
Definition: colvarcomp_torchann.cpp:222
virtual int init(std::string const &conf)
Definition: colvarcomp_torchann.cpp:212
Value of a collective variable: this is a metatype which can be set at runtime. By default it is set ...
Definition: colvarvalue.h:43
Collective variables main module.