Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/lib/include/common.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
#pragma once

#include "tensorflow/core/public/session.h"
#include "tensorflow/core/public/version.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/shape_inference.h"
#include <string>

using namespace tensorflow;
using namespace std;

#if TF_MAJOR_VERSION >= 2 && TF_MINOR_VERSION >= 2
typedef tensorflow::tstring STRINGTYPE;
#else
typedef std::string STRINGTYPE;
#endif

#include "NNPAtomMap.h"
#include <vector>
#include "version.h"
Expand Down
2 changes: 1 addition & 1 deletion source/lib/src/DataModifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ init (const string & model,
rcut = get_scalar<VALUETYPE>("descrpt_attr/rcut");
cell_size = rcut;
ntypes = get_scalar<int>("descrpt_attr/ntypes");
model_type = get_scalar<string>("model_attr/model_type");
model_type = get_scalar<STRINGTYPE>("model_attr/model_type");
get_vector<int>(sel_type, "model_attr/sel_type");
sort(sel_type.begin(), sel_type.end());
inited = true;
Expand Down
2 changes: 1 addition & 1 deletion source/lib/src/DeepTensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ init (const string & model,
rcut = get_scalar<VALUETYPE>("descrpt_attr/rcut");
cell_size = rcut;
ntypes = get_scalar<int>("descrpt_attr/ntypes");
model_type = get_scalar<string>("model_attr/model_type");
model_type = get_scalar<STRINGTYPE>("model_attr/model_type");
odim = get_scalar<int>("model_attr/output_dim");
get_vector<int>(sel_type, "model_attr/sel_type");
inited = true;
Expand Down
2 changes: 1 addition & 1 deletion source/lib/src/NNPInter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ compute (ENERGYTYPE & dener,
void
NNPInter::
get_type_map(std::string & type_map){
type_map = get_scalar<std::string>("model_attr/tmap");
type_map = get_scalar<STRINGTYPE>("model_attr/tmap");
}


Expand Down