关于SI语言的问题 - 页 10

 
Andrei Novichkov:
如果正常写入,它将返回一个指向结构的指针。

我明白,但什么会返回一个没有字段的结构?

 
它不会做任何事情。这只是某种例子,也许是一个测试,所以在我看来。请问,这个片段来自哪里?
 
Andrei Novichkov:
它不会做任何事情。这只是某种例子,也许是一个测试,所以在我看来。请问这个片段是哪里来的?

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

我曾尝试将tensorflow.dll库连接到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);
  }

它起作用了,在日志中得到以下信息:TF_Version=1.5.0

我被这个奇怪的构造困住了,(((((


库和头文件都在附件中。

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

我曾尝试将tensorflow.dll库连接到MQL5上。

它起作用了,在日志中得到以下信息:TF_Version=1.5.0

我被这个奇怪的构造困住了,(((((


库本身和头文件都在附件中。

你试过初始化数组吗?

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

你试过初始化数组吗?

我的例子是检查该库是否在MQL5中工作 - 是的,它是。

我不想写一个vrooper,我想在mql中建立头文件。


我有点明白我的问题了。

typedef struct TF_Status TF_Status;

我想我已经开始掌握它了。

struct TF_Status {
  tensorflow::Status status;
};
 
不出所料,编程已经变成了猜测。我想知道结果会是什么......
 
Igor Makanu:

我说的是别的东西,我的例子是检查这个库是否能在MQL5中工作--是的,它可以。

我不想写一个vrooper,我想在mql中建立头文件。


我对这个问题有点摸不着头脑了。

我想我已经在MQL5中得到了头文件,但我已经在MQL5中得到了它。

我想你自己已经猜到了)。只是结构本身的定义在其他地方,可能在另一个文件中。也许是在另一个图书馆)。

你不必一次写完所有东西。

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

typedef很可能被分离出来,在其他地方处理。

阿列克谢-塔拉巴诺夫
不出所料,编程已经变成了猜测。我想知道结果会是什么......
而且不需要猜测。他们一辈子都是这么唱的。
 

为什么不完善现有的TensorFlow和Pytorch的包装器?

为什么每个人都被吸引到重新发明自己的轮子?

没有Python的TensorFlow被削减了。而且,由于MQL和C/C++的不相容性,你不能在没有中间包装器的情况下将其连接到MQL。

 
Roffild:

为什么不完善现有的TensorFlow和Pytorch的包装器?

为什么每个人都被吸引到重新发明自己的轮子?

没有Python的TensorFlow被削减了。而且,由于MQL和C/C++的不兼容,如果没有中间包装器,就不可能正确地将其与MQL连接起来。

我已经看到了你的自行车,但现在我对TensorFlow开发者的实现感兴趣

ZS:也许今年会有一个C#的TensorFlow APIhttps://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:

但基本上我不明白TF_NewStatus()将返回什么

指向一块大小为4或8字节的数据的指针。

如果你使用类似pragma pack 1的东西,大小将是一样的(可能是1个字节)。