#include using namespace std; #define _dtype enum { undef,kFloat, kFloat32,} typedef _dtype dtype; namespace torch { _dtype; class Tensor { protected: int m_id; public: size_t size(); size_t size(int); Tensor &narrow(int, int, int); Tensor &contiguous(); }; class TensorOptions { public: dtype dtype (dtype typ) { return typ; }; }; void set_num_threads(size_t); Tensor ones(size_t sz); Tensor ones(size_t sz, dtype typ); Tensor ones(int sz1, int sz2, dtype typ); Tensor empty (size_t sz); Tensor empty (dtype); namespace nn { class Module { public: }; }; namespace serialize { class InputArchive { public: void load_from(std::string filename); }; class OutputArchive { public: void write(std::string, torch::Tensor); void save_to(std::string fname); }; }; }; #ifdef ARDUINO_ETC struct map_item { char *key1, *key2; int dim; // map_item(std::string str1, std::string str2, int n); map_item(const char *str1, const char *str2, int n) { key1 = (char*)(str1); key2 = (char*)(str2); dim = n; } }; #endif #ifdef ARDUINO_ETC namespace std { template class unordered_map { public: map_item *m_map; // unordered_map (); ~unordered_map (); void *unordered_map::operator new (size_t,void*); unordered_map *find_node (X &arg); char *get_data () { char *result = NULL; return result; } unordered_map *add_node (X &arg); }; #endif #define _foptions enum\ {\ overwrite_existing,\ } #if 0 namespace filesystem { class file_name { public: std::string folder; std::string name; std::string extension; }; class file_ptr { public: file_name path(); file_ptr& begin(); file_ptr& end(); bool is_regular_file() const; bool operator != (file_ptr&); file_ptr operator ++ (int); }; typedef _foptions copy_options; void create_directories(std::string); file_ptr directory_iterator(std::string); void path(std::string); void copy_file ( std::string file_path, std::string neew_path, copy_options ); }; }; #endif