Questions on the SI language - page 10

 
Andrei Novichkov:
If written normally, it will return a pointer to the structure.

I understand that, but what will return a structure that has no fields?

 
It won't do anything. It's just some kind of example, maybe a test, so it seems to me. Where is the fragment from, may I ask?
 
Andrei Novichkov:
It won't do anything. It's just some kind of example, maybe a test, so it seems to me. Where is the snippet from, may I ask?

tensorflow c++ apihttps://www.tensorflow.org/install/lang_c

I have tried to connect tensorflow.dll library to MQL5

#property strict

#define  PCHAR  long

#import "tensorflow.dll"
const PCHAR TF_Version();
#import

#import "msvcrt.dll"
int strcpy(uchar &dst[],PCHAR src);
#import
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   uchar byte[];
   ArrayResize(byte,300);
   PCHAR ptr;
//--- указатель на строку
   ptr=TF_Version();
   if(ptr>0) strcpy(byte,ptr);
   Print("TF_Version="+CharArrayToString(byte));
//---
   return(INIT_SUCCEEDED);
  }

it works, got the following in the log: TF_Version=1.5.0

I'm stuck with this strange construct (((((


Both the library and the header file are in the attachment.

Install TensorFlow for C  |  TensorFlow
Install TensorFlow for C  |  TensorFlow
  • www.tensorflow.org
TensorFlow provides a C API that can be used to build bindings for other languages. The API is defined in and designed for simplicity and uniformity rather than convenience. Supported Platforms TensorFlow for C is supported on the following systems: Setup Download TensorFlow C libraryURL Extract Extract the downloaded archive, which contains...
 
Igor Makanu:

tensorflow c++ apihttps://www.tensorflow.org/install/lang_c

I have tried to connect tensorflow.dll library to MQL5

it works, got the following in the log: TF_Version=1.5.0

I'm stuck with this strange construct (((((


The library itself and the header file are in the attachment

Have you tried initialising arrays?

 
Алексей Тарабанов:

Have you tried initialising arrays?

My example is to check if the library works in MQL5 - yes it does.

i don't want to write a vrooper, i want to build the header file in mql


I'm kind of getting to the bottom of my question.

typedef struct TF_Status TF_Status;

I think I've started to get the hang of it:

struct TF_Status {
  tensorflow::Status status;
};
 
Quite expectedly, programming has turned into guessing. I wonder what the outcome will be...
 
Igor Makanu:

I'm talking about something else, my example is checking if the library will work in MQL5 - yes it will

i don't want to write a vrooper, i want to build the header file in mql


I'm kind of getting to the bottom of this question.

I think I've already got the header file in MQL5, but I've already got it in MQL5:

I think you've guessed it yourself.) Just the definition of the structure itself somewhere else, possibly in another file. Perhaps in another library.)

You don't have to write everything at once:

typedef struct TF_Status {
int if;
long lf;
.....
} TF_Status, *PTF_Status;

typedef may well be detached and dealt with elsewhere.

Alexei Tarabanov:
Quite expectedly, programming has turned into guessing. I wonder what the outcome will be...
And no guessing. That's how they've been singing all their lives.
 

Why not refine existing wrappers for TensorFlow and Pytorch?

Why is everyone drawn to reinventing their own wheel?

TensorFlow without Python is cut down. And you can't connect it to MQL without the intermediate wrapper because of the incompatibility of MQL and C/C++.

 
Roffild:

Why not refine existing wrappers for TensorFlow and Pytorch?

Why is everyone drawn to reinventing their own wheel?

TensorFlow without Python is cut down. And it's impossible to correctly connect it to MQL without the intermediate wrapper because of the incompatibility of MQL and C/C++.

I have seen your bicycle but for now I am interested in the implementation from TensorFlow developers

ZS: maybe this year there will be a TensorFlow API in C#https://www.tensorflow.org/lite/guide/roadmap

TensorFlow Lite 2019 Roadmap  |  TensorFlow Lite  |  TensorFlow
  • www.tensorflow.org
Updated: March 6th, 2019 The following represents a high level overview of our 2019 plan. You should be conscious that this roadmap may change at anytime relative to a range of factors and the order below does not reflect any type of priority. As a matter of principle, we typically prioritize issues that the majority of our users are asking for...
 
Igor Makanu:

but basically I don't understand whatTF_NewStatus()will return?

a pointer to a piece of data of size 4 or 8 bytes.

the size depends on the platform because of the alignment. if you use something like pragma pack 1, the size will be the same (1 byte probably)