Instructions to use ReasoningKingdom/LITOperator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use ReasoningKingdom/LITOperator with LeRobot:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
File size: 2,052 Bytes
1c9a8b0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | /*
* dense.c — the dense body simulator: symbols x symbols x time.
*
* The body is never stored. Every cell is a coordinate name, and the
* cut mask is a function evaluated on demand. A search therefore
* spends memory only on the tree it walks.
*/
#include "dense.h"
#include <string.h>
int dense_init(dense *d, uint32_t symbols, uint64_t steps,
int (*cut)(void *ctx, uint32_t a, uint32_t b, uint64_t t),
void *ctx)
{
uint64_t x2;
if (!d || symbols == 0 || steps == 0) {
return -1;
}
x2 = (uint64_t)symbols * symbols;
if (x2 > UINT64_MAX / steps) {
return -1;
}
memset(d, 0, sizeof(*d));
d->symbols = symbols;
d->steps = steps;
d->cells = x2 * steps;
d->cut = cut;
d->ctx = ctx;
return 0;
}
void dense_free(dense *d)
{
if (d) {
memset(d, 0, sizeof(*d));
}
}
uint64_t dense_cells(const dense *d)
{
return d ? d->cells : 0;
}
uint64_t dense_index(const dense *d, uint32_t a, uint32_t b,
uint64_t t)
{
if (!d || a >= d->symbols || b >= d->symbols || t >= d->steps) {
return UINT64_MAX;
}
return ((t * d->symbols + a) * d->symbols) + b;
}
int dense_cell(const dense *d, uint64_t cell, uint32_t *a,
uint32_t *b, uint64_t *t)
{
uint64_t x2;
if (!d || cell >= d->cells) {
return -1;
}
x2 = (uint64_t)d->symbols * d->symbols;
if (a) {
*a = (uint32_t)((cell / d->symbols) % d->symbols);
}
if (b) {
*b = (uint32_t)(cell % d->symbols);
}
if (t) {
*t = cell / x2;
}
return 0;
}
int dense_cut(const dense *d, uint64_t cell)
{
uint32_t a;
uint32_t b;
uint64_t t;
uint64_t x2;
if (!d || cell >= d->cells) {
return 1;
}
if (!d->cut) {
return 0;
}
x2 = (uint64_t)d->symbols * d->symbols;
b = (uint32_t)(cell % d->symbols);
a = (uint32_t)((cell / d->symbols) % d->symbols);
t = cell / x2;
return d->cut(d->ctx, a, b, t) ? 1 : 0;
}
|