Struct Obj¶
Defined in File interpreter_impl.h
Struct Documentation¶
-
struct Obj¶
this is a wrapper class that refers to a PyObject* instance in a particular interpreter.
We can’t use normal PyObject or pybind11 objects here because these objects get used in a user application which will not directly link against libpython. Instead all owningSession with the Python state in each interpreter is done via this wrapper class, and methods on InterpreterSession.
Public Functions
-
inline Obj()¶
-
inline at::IValue toIValue() const¶
Converts the python object to a C++ at::IValue.
-
inline Obj operator()(at::ArrayRef<Obj> args)¶
Call an
Obj
callable, with arguments given by the tuple args.Equivalent to
__call__
in python.
-
inline Obj operator()(at::ArrayRef<at::IValue> args)¶
Call an
Obj
callable, with arguments given by the tuple args.Equivalent to
__call__
in python.
-
inline Obj callKwargs(std::vector<at::IValue> args, std::unordered_map<std::string, c10::IValue> kwargs)¶
Call an
Obj
callable, with arguments given by the tuple args, and named arguments given by the dictionary kwargs.Equivalent to
__call__
in python.
-
inline Obj callKwargs(std::unordered_map<std::string, c10::IValue> kwargs)¶
Call an
Obj
callable, with named arguments given by the dictionary kwargs.Equivalent to
__call__
in python.
-
inline Obj()¶