Skip to content

Commit

Permalink
Remove TensorActivation.get2
Browse files Browse the repository at this point in the history
Workaround to make get2 return a function pointer did not work.
  • Loading branch information
HGuillemet committed Jul 12, 2023
1 parent aba8fd8 commit 83dce9c
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;

/* This is a modified version of the variant container whose get2 method
* returns a function pointer instead of a std::function */
/* This is a modified version of the variant container without the get2 method, that would
* return a std::function and not a function pointer. */
@NoOffset @Name("c10::variant<torch::enumtype::kReLU,torch::enumtype::kGELU,std::function<torch::Tensor(const torch::Tensor&)> >") @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
public class TransformerActivation extends Pointer {
static {
Expand Down Expand Up @@ -58,18 +58,6 @@ public kGELU get1() {

@ValueSetter public native TransformerActivation put(@ByRef kGELU value);

public TensorMapper get2() {
return get2(this).target();
}

@Namespace @Name("c10::get<2>") static native @ByRef TensorMapperFunction get2(@ByRef TransformerActivation container);

@ValueSetter public native TransformerActivation put(@ByRef TensorMapper value);

@Name("std::function<torch::Tensor(const torch::Tensor&)>")
@Namespace
static class TensorMapperFunction extends Pointer {
@Name("target<torch::Tensor(const torch::Tensor&)>") native TensorMapper target();
}
}

0 comments on commit 83dce9c

Please sign in to comment.