MCPcopy Create free account
hub / github.com/dmlc/xgboost / Matrix_ArrayInterface

Function Matrix_ArrayInterface

demo/c-api/inference/inference.c:77–84  ·  view source on GitHub ↗

Array interface specified by numpy. */

Source from the content-addressed store, hash-verified

75
76/* Array interface specified by numpy. */
77char const *Matrix_ArrayInterface(Matrix self) {
78 char const template[] = "{\"data\": [%lu, true], \"shape\": [%lu, %lu], "
79 "\"typestr\": \"<f4\", \"version\": 3}";
80 memset(self->_array_intrerface, '\0', sizeof(self->_array_intrerface));
81 sprintf(self->_array_intrerface, template, (size_t)self->data, self->shape[0],
82 self->shape[1]);
83 return self->_array_intrerface;
84}
85
86size_t Matrix_NSamples(Matrix self) { return self->shape[0]; }
87

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected