Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java pytorch why not support boolArray generate boolTensor but has func to use? #1567

Open
mullerhai opened this issue Jan 10, 2025 · 0 comments

Comments

@mullerhai
Copy link

mullerhai commented Jan 10, 2025

hi, we write code like this


import org.bytedeco.javacpp.BoolPointer;
import org.bytedeco.javacpp.DoublePointer;
import org.bytedeco.pytorch.DoubleArrayRef;
import org.bytedeco.pytorch.BoolArrayRef;
import org.bytedeco.pytorch.global.torch;

        boolean[] boolArray ={true,false,true,true} ; // new boolean[]
        BoolArrayRef arrayRef1 = new BoolArrayRef(boolArray,4);
        torch.tensor(arrayRef1);

console error

C:\Users\jeffsyry\.jdks\graalvm-ce-17.0.9\bin\java.exe "
Exception in thread "main" java.lang.RuntimeException: "tensor_cpu" not implemented for 'Bool'
Exception raised from operator () at D:\a\javacpp-presets\javacpp-presets\pytorch\cppbuild\windows-x86_64-gpu\pytorch\aten\src\ATen\Utils.cpp:28 (most recent call first):
00007FFF7CE283C9 <unknown symbol address> c10.dll!<unknown symbol> [<unknown file> @ <unknown line number>]
00007FFF7CE26C5A <unknown symbol address> c10.dll!<unknown symbol> [<unknown file> @ <unknown line number>]
00007FFE7A9A1949 <unknown symbol address> torch_cpu.dll!<unknown symbol> [<unknown file> @ <unknown line number>]
00007FFE7A9A0C02 <unknown symbol address> torch_cpu.dll!<unknown symbol> [<unknown file> @ <unknown line number>]
00007FFE7A9A4ABB <unknown symbol address> torch_cpu.dll!<unknown symbol> [<unknown file> @ <unknown line number>]
00007FFF5A398C0E <unknown symbol address> jnitorch.dll!<unknown symbol> [<unknown file> @ <unknown line number>]
000001CDA022D1C1 <unknown symbol address> !<unknown symbol> [<unknown file> @ <unknown line number>]

	at org.bytedeco.pytorch.global.torch.tensor(Native Method)
	at org.example.Main.main(Main.java:41)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants