Kalleby Santos
How to extend `serde_v8` to handle custom logic?
Hi guys! I'm currently I have the following struct to represent my Tensor object:
It's working well with
#[serde]
attribute on my op
function. The problem is that I need to extend it to also support string
arrays like: ["foo", "bar"]
, and I can't handle it as JsBuffer
so I need to explicit do pattern matching:
---
From the Js land I need to pass an object with the given format, where TypedArray
could be any theses:
The problem is that even if I use #[serde(untagged)]
:
I can't handle JsBuffer
, cause of the following error:
2 replies
RustyV8: Example of creating a TypedArray?
Hey there, I'm currently trying to Zero-copy my
ort::Tensor
to a v8::TypedArray
, but I can't figure out how to work with the byte_offset
and length
parameters of v8::Float32Array
or other TypedArray
variant.
Here is an example of my code:
3 replies