Skip to content

Commit

Permalink
Use full declaration name for constructor templates
Browse files Browse the repository at this point in the history
  • Loading branch information
HGuillemet committed Dec 30, 2023
1 parent 0153ec1 commit f14ce0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytorch/src/main/java/org/bytedeco/pytorch/presets/torch.java
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ public void map(InfoMap infoMap) {
.put(new Info("c10::requires_grad", "at::range", "at::bernoulli_out", "at::normal_out", "at::stft").skipDefaults())
.put(new Info("c10::prim::requires_grad").javaNames("requires_grad"))
.put(new Info("c10::aten::clone").javaNames("_clone"))
.put(new Info("c10::TensorOptions<c10::Device>").javaNames("TensorOptions"))
.put(new Info("c10::detail::_str<CompileTimeEmptyString>").javaNames("_strCompileTimeEmptyString"))
.put(new Info("at::TensorBase").base("AbstractTensor").pointerTypes("TensorBase"))
;
Expand Down Expand Up @@ -1989,6 +1988,7 @@ We need either to put an annotation info on each member, or javaName("@NoOffset
"@Namespace(\"at\") public static native @ByVal @Name(\"make_generator<at::CPUGeneratorImpl>\") Generator make_generator_cpu();\n" +
"@Namespace(\"at\") public static native @ByVal @Name(\"make_generator<at::CPUGeneratorImpl,uint64_t>\") Generator make_generator_cpu(@Cast(\"uint64_t&&\") long seed_in);"
))
.put(new Info("c10::TensorOptions::TensorOptions<c10::Device>").javaNames("XXX"))
;

for (String[] t : new String[][]{
Expand Down Expand Up @@ -2593,7 +2593,7 @@ void mapArrayRef(InfoMap infoMap) {
// Relies on the fact that std::vector info are created before.
Info vectorInfo = infoMap.getFirst(template("std::vector", elementTypes[0]), false);
if (vectorInfo != null && !elementTypes[0].equals("bool"))
infoMap.put(new Info(template(cppNames[0], template("std::allocator", elementTypes[0])) + "(" + elementTypes[0] + "*)")
infoMap.put(new Info(template(cppNames[0] + "::ArrayRef", template("std::allocator", elementTypes[0])) + "(" + elementTypes[0] + "*)").javaNames("XXX")
.javaText(
"public " + baseJavaName + "ArrayRef(@ByRef " + baseJavaName + "Vector vec) { super((Pointer)null); allocate(vec); }\n"
+ "private native void allocate(@ByRef " + baseJavaName + "Vector vec);"));
Expand Down

0 comments on commit f14ce0e

Please sign in to comment.