Questions tagged [c-api]
154 questions
1
vote
2 answers
Call C API with vector of strings from C++
In my C++ application, I use an external library that exposes a C API. Some of the C functions take arrays of strings as input and use char** for that:
void c_api_function(char** symbols, int count);
(Note: I think a pointer to const would be more…

pschill
- 5,055
- 1
- 21
- 42
1
vote
0 answers
Python Method Call in a C++ Code through Python C-API
I am working on my Project which implies the use of Empirical Mode Decomposition in C++ for EEG Signals. The input Data is Eigen::MatrixXd, where the rows are the Channels and the columns are the samples.
I did not found a good C++ library for EMD…

Youssef Zarca
- 11
- 2
1
vote
0 answers
In Lua, access the evaluated value of a C function addressed via a userdata table
I have a piece of lua code that is called from a C program that passes it a table.
The table contains a table which has a field that LUA reports is of type "function".
I want to invoke that function and get its return value, but the following just…

LucyLa
- 43
- 4
1
vote
3 answers
Tensorflow c_api (1.13.2) - Import LSTM .pb: Expected input[1] to be a control input
I'm currently working on importing a trained (python3.8, TF==2.3) LSTM-Model by using the C-API (TF==1.13.2). I have to stick with this software versions. I try to show my steps so far using a dummy-example.
My model description (for dummy import…

Dandyman
- 11
- 3
1
vote
0 answers
How can I confine TensorFlow C API to use one and only one thread in total
I'm using TensorFlow C API in C++ on linux to load a face detection model for inference. TensorFlow generates multiple threads and I want to restrict or confine the process to use one and only one thread. How can I confine TensorFlow C API to…

fisakhan
- 704
- 1
- 9
- 27
1
vote
0 answers
Is there a way to supress TensorFlow logging in C-API
I managed to run my SavedModel generated by Python using C-API. Now I want to suppress all the verbose from TensorFlow as below:
2020-07-17 13:44:45.358903: I tensorflow/cc/saved_model/reader.cc:31] Reading SavedModel from:…

philgun
- 149
- 8
1
vote
1 answer
C-API from Python - How can I get a string?
Euler Math Toolbox (www.euler-math-toolbox.de) has an interface with Python 2. Now it should interface with Python 3. But I seem to be unable to read output from Python. Below is a simple example of what I am trying to do. The code fails in the last…

Rene
- 3,746
- 9
- 29
- 33
1
vote
1 answer
Segmentation fault creating PyArrayObject using PyArray_SimpleNew
I am creating a C extension for numpy. The function should return an array, so I decided to create a PyArrayObject with dimensions 50x10 using PyArray_SimpleNew and later fill it with some values. Here is the code:
PyArrayObject *a; npy_intp…

German Farinas
- 61
- 5
1
vote
1 answer
Meta-language to describe types in a language-independent way for a "C-API"
Is there a meta-language to describe types (structures/records, function types and their parameters ...) and constants that can be fed to a tool or that I can then write code for to create prototypes for multiple target languages? Note: (E)BNF is…

0xC0000022L
- 20,597
- 9
- 86
- 152
1
vote
1 answer
SQLite C API equivalent to typeof(col)
I want to detect column data types of any SELECT query in SQLite.
In the C API, there is const char *sqlite3_column_decltype(sqlite3_stmt*,int) for this purpose. But that only works for columns in a real table. Expressions, such as LOWER('ABC'), or…

Anse
- 1,573
- 12
- 27
1
vote
0 answers
Tensorflow v2.0.0 c-api crashes when loading "saved_model" format Keras model
Tensorflow v2.0.0 segfaults when trying to load a model using the C_API.
The Keras model is absurdly simple:
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Dense(512, activation='relu',…

Zendel
- 485
- 3
- 14
1
vote
0 answers
How to retrieve data from a returned numpy array in a C program?
I have a main program written in C and would like to use an already written library in Python, so I embedded some C-Python API into my C program.
I have successfully created a PyObject that represents a numpy array, containing float data in C, and…

bigchaipat
- 843
- 1
- 7
- 8
1
vote
0 answers
SQLite/AutoHotkey, I have problem with Encoding of sqlite3_result_text return function
I am writing a User Define Function with SQLite in AutoHotkey.
It works well as I intended when I use (return) English only.
But, If I use (return) any character with NonEnglish, it makes broken result.
The broken result has, for me, some rules -…

Kita Nagoya
- 100
- 6
1
vote
0 answers
Lua version at runtime
I am trying to make a fat runtime library (in C) for lua using ifunc attribute, to do so i need the lua version from the C api at runtime for my resolver function.
I know there are the _VERSION stored somewhere in the global table but i can't rely…

nepta
- 31
- 3
1
vote
0 answers
How to disable warnings in tensorflow written to output when using the c api of tensorflow
I use TensorFlow 1.13.1 by integrating it using the C-API (my program is in C++). Tensor flow writes a warning to the std output, and I want to suppress this warning as I a need the std output and std error under my control, not wanting tensorflow…

Hikaru
- 11
- 2