21#include <tensorflow/core/framework/graph.pb.h>
31bool HasAttr(
const tensorflow::NodeDef &,
const std::string &);
32tensorflow::DataType
GetDataTypeAttr(
const tensorflow::NodeDef &,
const std::string &);
33tensorflow::TensorProto *
GetTensorAttr(tensorflow::NodeDef &,
const std::string &);
44 : _argc(static_cast<unsigned int>(argc)), _argv{argv}
48 std::string
get(
unsigned int index)
const;
49 std::string
get_or(
unsigned int index,
const std::string &)
const;
53 const char *
const *_argv;
59 std::istream *
in()
const {
return _in ? _in.get() : &std::cin; }
60 std::ostream *
out()
const {
return _out ? _out.get() : &std::cout; }
63 void in(std::unique_ptr<std::istream> &&
in) { _in = std::move(
in); }
64 void out(std::unique_ptr<std::ostream> &&
out) { _out = std::move(
out); }
67 std::unique_ptr<std::istream> _in;
68 std::unique_ptr<std::ostream> _out;
71std::unique_ptr<IOConfiguration>
make_ioconfig(
const CmdArguments &cmdargs);
CmdArguments(int argc, const char *const *argv)
std::string get_or(unsigned int index, const std::string &) const
std::string get(unsigned int index) const
std::istream * in() const
std::ostream * out() const
void out(std::unique_ptr< std::ostream > &&out)
void in(std::unique_ptr< std::istream > &&in)
bool HasAttr(const tensorflow::NodeDef &node, const std::string &attr_name)
int GetElementCount(const tensorflow::TensorShapeProto &shape)
GetElementCount returns -1 for rank-0 tensor shape.
tensorflow::TensorProto * GetTensorAttr(tensorflow::NodeDef &node, const std::string &attr_name)
tensorflow::DataType GetDataTypeAttr(const tensorflow::NodeDef &node, const std::string &attr_name)
std::unique_ptr< IOConfiguration > make_ioconfig(const CmdArguments &cmdargs)