12#include "lwtnn/LightweightGraph.hh"
13#include "lwtnn/parse_json.hh"
26 ATH_MSG_DEBUG(
"Making a new m_lwtnn_graph for copied network");
27 std::stringstream json_stream(
m_json);
28 const lwt::GraphConfig
config = lwt::parse_json_graph(json_stream);
43 ATH_MSG_VERBOSE(
"Reading the m_json string stream into a graph network");
44 std::stringstream json_stream(
m_json);
45 const lwt::GraphConfig
config = lwt::parse_json_graph(json_stream);
50 const std::string node_name =
node.first;
51 const lwt::OutputNodeConfig node_config =
node.second;
52 for (
const std::string &
label : node_config.labels) {
73 if (inputs.find(
"Noise") != inputs.end()) {
76 auto noiseNode = local_copy.extract(
"Noise");
77 noiseNode.key() =
"node_0";
78 local_copy.insert(std::move(noiseNode));
79 auto mycondNode = local_copy.extract(
"mycond");
80 mycondNode.key() =
"node_1";
81 local_copy.insert(std::move(mycondNode));
87 ATH_MSG_DEBUG(
"Computation on LWTNN graph network done, returning.");
92void TFCSGANLWTNNHandler::Streamer(TBuffer &buf) {
94 if (buf.IsReading()) {
97 TFCSGANLWTNNHandler::Class()->ReadBuffer(buf,
this);
103#ifndef __FastCaloSimStandAlone__
113 "Writing buffer in TFCSGANLWTNNHandler, but m_json is empty");
116 TFCSGANLWTNNHandler::Class()->WriteBuffer(buf,
this);
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
void setupNet() override
Perform actions that prepare network for use.
std::string * m_input
Do not persistify.
NetworkOutputs compute(NetworkInputs const &inputs) const override
Function to pass values to the network.
TFCSGANLWTNNHandler(const std::string &inputFile)
TFCSGANLWTNNHandler constructor.
std::unique_ptr< lwt::LightweightGraph > m_lwtnn_graph
The network that we are wrapping here.
VNetworkLWTNN(const VNetworkLWTNN ©_from)
VNetworkLWTNN copy constructor.
std::vector< std::string > getOutputLayers() const override
List the names of the outputs.
std::vector< std::string > m_outputLayers
Do not persistify.
std::map< std::string, std::map< std::string, double > > NetworkInputs
Format for network inputs.
std::map< std::string, double > NetworkOutputs
Format for network outputs.
void removePrefixes(NetworkOutputs &outputs) const
Remove any common prefix from the outputs.
void deleteAllButNet() override
Get rid of any memory objects that arn't needed to run the net.
std::string m_json
String containing json input file.
void setupPersistedVariables() override
Perform actions that prep data to create the net.
std::string label(const std::string &format, int i)