初次提交
This commit is contained in:
24
cxx/common/node.h
Normal file
24
cxx/common/node.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef __COMMON_NODE_H__
|
||||
#define __COMMON_NODE_H__
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <napi.h>
|
||||
|
||||
#define NODE_INIT_OBJECT(name, function) \
|
||||
do \
|
||||
{ \
|
||||
auto obj = Napi::Object::New(env); \
|
||||
function(env, obj); \
|
||||
exports.Set(Napi::String::New(env, #name), obj); \
|
||||
} while (0)
|
||||
|
||||
inline uint64_t __node_ptr_of__(Napi::Value value)
|
||||
{
|
||||
bool lossless;
|
||||
return value.As<Napi::BigInt>().Uint64Value(&lossless);
|
||||
}
|
||||
|
||||
#define NODE_PTR_OF(type, value) (reinterpret_cast<type *>(__node_ptr_of__(value)))
|
||||
|
||||
#endif
|
24
cxx/common/session.h
Normal file
24
cxx/common/session.h
Normal file
@ -0,0 +1,24 @@
|
||||
#ifndef __COMMON_SESSION_H__
|
||||
#define __COMMON_SESSION_H__
|
||||
#include <iostream>
|
||||
|
||||
namespace ai
|
||||
{
|
||||
|
||||
class Tensor
|
||||
{
|
||||
public:
|
||||
virtual ~Tensor() {}
|
||||
};
|
||||
|
||||
class Session
|
||||
{
|
||||
public:
|
||||
virtual ~Session() {}
|
||||
|
||||
virtual const std::map<std::string, std::vector<int>> &getInputShapes() const = 0;
|
||||
virtual const std::map<std::string, std::vector<int>> &getOutputShapes() const = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user