-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass
wasm_api::Tensor
into TensorList::push
by-reference
Work around a bug [1] in wasm-bindgen when passing structs by-value into methods, by passing `wasm_api::Tensor`s by-reference. In order to do this without copying the underlying tensor, make `wasm_api::Tensor` use an Rc to manage its output reference. Alternative solutions would be to fix the issue in wasm-bindgen upstream or to patch generated JS code snippets like this: ``` var ptr0 = someArg.ptr; somePtr.ptr = 0; ``` To be like this instead: ``` var ptr0 = someArg.__destroy_into_raw(); ``` [1] rustwasm/wasm-bindgen#2677
- Loading branch information
1 parent
503fec6
commit f992cca
Showing
1 changed file
with
17 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters