You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to serialize tensors or modules to something else than files using OutputArchive.save_to(WriteFunction) causes a segmentation fault.
import org.bytedeco.javacpp.annotation.*;
import org.bytedeco.pytorch.presets.torch.*;
import org.bytedeco.pytorch.*;
import org.bytedeco.javacpp.*;
class T {
static WriteFunction wf = new WriteFunction() {
@Override
@Virtual
public long call(Pointer buf, long nbytes) {
System.err.println("writing "+nbytes);
return nbytes;
}
};
public static void main(String[] a) {
OutputArchive oa = new OutputArchive();
Tensor t = AbstractTensor.create(1F, 2F);
oa.write("test", t);
oa.save_to(wf);
}
}
Trying to serialize tensors or modules to something else than files using
OutputArchive.save_to(WriteFunction)
causes a segmentation fault.The equivalent following C++ code does work:
The text was updated successfully, but these errors were encountered: