to avoid
-// leaking DLPack implementation detail to every project that includes `ATen/Context.h`, which in turn
-// would lead to a conflict when linked with another project using DLPack (for example TVM)
-@Opaque @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
-public class DLDevice_ extends Pointer {
+// Forward declare DynamicLibrary
+@Namespace("at") @Opaque @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
+public class DynamicLibrary extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
- public DLDevice_() { super((Pointer)null); }
+ public DynamicLibrary() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
- public DLDevice_(Pointer p) { super(p); }
+ public DynamicLibrary(Pointer p) { super(p); }
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/EnumHolderPtr.java b/pytorch/src/gen/java/org/bytedeco/pytorch/EnumHolderPtr.java
index 8744b022f2d..69763f3177b 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/EnumHolderPtr.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/EnumHolderPtr.java
@@ -53,6 +53,10 @@ public class EnumHolderPtr extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) EnumHolderPtr put(@ByRef(true) EnumHolderPtr rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) EnumHolder get();
public native @ByRef @Name("operator *") @NoException(true) EnumHolder multiply();
@@ -68,9 +72,9 @@ public class EnumHolderPtr extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class EnumHolderPtr extends Pointer {
*/
public static native @ByVal EnumHolderPtr unsafe_adapt_non_heap_allocated(
EnumHolder raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/Float8_e5m2fnuz.java b/pytorch/src/gen/java/org/bytedeco/pytorch/Float8_e5m2fnuz.java
index 1b7382cbf63..8d7862155bb 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/Float8_e5m2fnuz.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/Float8_e5m2fnuz.java
@@ -43,4 +43,5 @@ public class Float8_e5m2fnuz extends Pointer {
private native void allocate(float value);
public native @Name("operator float") float asFloat();
public native @Cast("bool") boolean isnan();
+ public native @Cast("bool") boolean isinf();
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/FuturePtr.java b/pytorch/src/gen/java/org/bytedeco/pytorch/FuturePtr.java
index 17f7e70c8a0..e1e3298ceb1 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/FuturePtr.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/FuturePtr.java
@@ -53,6 +53,10 @@ public class FuturePtr extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) FuturePtr put(@ByRef(true) FuturePtr rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) Future get();
public native @ByRef @Name("operator *") @NoException(true) Future multiply();
@@ -68,9 +72,9 @@ public class FuturePtr extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class FuturePtr extends Pointer {
*/
public static native @ByVal FuturePtr unsafe_adapt_non_heap_allocated(
Future raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/GeneratorImplPtr.java b/pytorch/src/gen/java/org/bytedeco/pytorch/GeneratorImplPtr.java
index c193fb90c30..72996e68657 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/GeneratorImplPtr.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/GeneratorImplPtr.java
@@ -53,6 +53,10 @@ public class GeneratorImplPtr extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) GeneratorImplPtr put(@ByRef(true) GeneratorImplPtr rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) GeneratorImpl get();
public native @ByRef @Name("operator *") @NoException(true) GeneratorImpl multiply();
@@ -68,9 +72,9 @@ public class GeneratorImplPtr extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class GeneratorImplPtr extends Pointer {
*/
public static native @ByVal GeneratorImplPtr unsafe_adapt_non_heap_allocated(
GeneratorImpl raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/HIPHooksInterface.java b/pytorch/src/gen/java/org/bytedeco/pytorch/HIPHooksInterface.java
index af34f7bc116..4069d8ea30c 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/HIPHooksInterface.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/HIPHooksInterface.java
@@ -50,7 +50,7 @@ public class HIPHooksInterface extends Pointer {
public native @Cast("bool") boolean hasHIP();
- public native @Cast("int64_t") long current_device();
+ public native @Cast("c10::DeviceIndex") byte current_device();
public native Allocator getPinnedMemoryAllocator();
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/Half.java b/pytorch/src/gen/java/org/bytedeco/pytorch/Half.java
index f82960077e1..3447c5fca84 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/Half.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/Half.java
@@ -43,9 +43,12 @@ public class Half extends Pointer {
public Half(@Cast("unsigned short") short bits, @ByVal from_bits_t arg1) { super((Pointer)null); allocate(bits, arg1); }
private native void allocate(@Cast("unsigned short") short bits, @ByVal from_bits_t arg1);
+// #if defined(__aarch64__) && !defined(C10_MOBILE) && !defined(__CUDACC__)
+// #else
public Half(float value) { super((Pointer)null); allocate(value); }
private native void allocate(float value);
public native @Name("operator float") float asFloat();
+// #endif
// #if defined(__CUDACC__) || defined(__HIPCC__)
// #endif
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/LPPool3dImpl.java b/pytorch/src/gen/java/org/bytedeco/pytorch/LPPool3dImpl.java
new file mode 100644
index 00000000000..461a6d50ebd
--- /dev/null
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/LPPool3dImpl.java
@@ -0,0 +1,49 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.pytorch;
+
+import org.bytedeco.pytorch.Allocator;
+import org.bytedeco.pytorch.Function;
+import org.bytedeco.pytorch.functions.*;
+import org.bytedeco.pytorch.Module;
+import org.bytedeco.javacpp.annotation.Cast;
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+import static org.bytedeco.openblas.global.openblas_nolapack.*;
+import static org.bytedeco.openblas.global.openblas.*;
+
+import static org.bytedeco.pytorch.global.torch.*;
+
+
+// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LPPool3d ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+/** Applies the LPPool3d function element-wise.
+ * See https://pytorch.org/docs/master/nn.html#torch.nn.LPPool3d to learn
+ * about the exact behavior of this module.
+ *
+ * See the documentation for {@code torch::nn::LPPool3dOptions} class to learn what
+ * constructor arguments are supported for this module.
+ *
+ * Example:
+ * {@code
+ * LPPool3d model(LPPool3dOptions(1, std::vector({3, 4, 5})).stride(
+ * {5, 6, 7}).ceil_mode(true));
+ * }
*/
+@Namespace("torch::nn") @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
+public class LPPool3dImpl extends LPPool3dImplBase {
+ static { Loader.load(); }
+
+
+ public LPPool3dImpl(double norm_type, @ByVal @Cast("torch::ExpandingArray<3>*") LongPointer kernel_size) { super((Pointer)null); allocate(norm_type, kernel_size); }
+ private native void allocate(double norm_type, @ByVal @Cast("torch::ExpandingArray<3>*") LongPointer kernel_size);
+ public LPPool3dImpl(@Const @ByRef LPPool3dOptions options_) { super((Pointer)null); allocate(options_); }
+ private native void allocate(@Const @ByRef LPPool3dOptions options_);
+ /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+ public LPPool3dImpl(Pointer p) { super(p); }
+
+
+ public native @ByVal Tensor forward(@Const @ByRef Tensor input);
+}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/LPPool3dImplBase.java b/pytorch/src/gen/java/org/bytedeco/pytorch/LPPool3dImplBase.java
new file mode 100644
index 00000000000..f96c6ef80ff
--- /dev/null
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/LPPool3dImplBase.java
@@ -0,0 +1,37 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.pytorch;
+
+import org.bytedeco.pytorch.Allocator;
+import org.bytedeco.pytorch.Function;
+import org.bytedeco.pytorch.functions.*;
+import org.bytedeco.pytorch.Module;
+import org.bytedeco.javacpp.annotation.Cast;
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+import static org.bytedeco.openblas.global.openblas_nolapack.*;
+import static org.bytedeco.openblas.global.openblas.*;
+
+import static org.bytedeco.pytorch.global.torch.*;
+
+@Name("torch::nn::LPPoolImpl<3,torch::nn::LPPool3dImpl>") @NoOffset @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
+public class LPPool3dImplBase extends LPPool3dImplCloneable {
+ static { Loader.load(); }
+ /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+ public LPPool3dImplBase(Pointer p) { super(p); }
+
+ public LPPool3dImplBase(double norm_type, @ByVal @Cast("torch::ExpandingArray<3>*") LongPointer kernel_size) { super((Pointer)null); allocate(norm_type, kernel_size); }
+ private native void allocate(double norm_type, @ByVal @Cast("torch::ExpandingArray<3>*") LongPointer kernel_size);
+ public LPPool3dImplBase(@Const @ByRef LPPool3dOptions options_) { super((Pointer)null); allocate(options_); }
+ private native void allocate(@Const @ByRef LPPool3dOptions options_);
+
+ public native void reset();
+
+ /** Pretty prints the {@code LPPool{1,2}d} module into the given {@code stream}. */
+ public native void pretty_print(@Cast("std::ostream*") @ByRef Pointer stream);
+
+ public native @ByRef LPPool3dOptions options(); public native LPPool3dImplBase options(LPPool3dOptions setter);
+}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/LPPool3dImplCloneable.java b/pytorch/src/gen/java/org/bytedeco/pytorch/LPPool3dImplCloneable.java
new file mode 100644
index 00000000000..f312956c232
--- /dev/null
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/LPPool3dImplCloneable.java
@@ -0,0 +1,37 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.pytorch;
+
+import org.bytedeco.pytorch.Allocator;
+import org.bytedeco.pytorch.Function;
+import org.bytedeco.pytorch.functions.*;
+import org.bytedeco.pytorch.Module;
+import org.bytedeco.javacpp.annotation.Cast;
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+import static org.bytedeco.openblas.global.openblas_nolapack.*;
+import static org.bytedeco.openblas.global.openblas.*;
+
+import static org.bytedeco.pytorch.global.torch.*;
+
+@Name("torch::nn::Cloneable") @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
+public class LPPool3dImplCloneable extends Module {
+ static { Loader.load(); }
+ /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+ public LPPool3dImplCloneable(Pointer p) { super(p); }
+
+
+ /** {@code reset()} must perform initialization of all members with reference
+ * semantics, most importantly parameters, buffers and submodules. */
+ public native void reset();
+
+ /** Performs a recursive "deep copy" of the {@code Module}, such that all parameters
+ * and submodules in the cloned module are different from those in the
+ * original module. */
+ public native @SharedPtr("torch::nn::Module") @ByVal Module clone(
+ @Const @ByRef(nullValue = "c10::optional(c10::nullopt)") DeviceOptional device);
+ public native @SharedPtr("torch::nn::Module") @ByVal Module clone();
+}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/Library.java b/pytorch/src/gen/java/org/bytedeco/pytorch/Library.java
index 0c021da8d99..bba6dc0b4e8 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/Library.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/Library.java
@@ -261,4 +261,7 @@ private native void allocate(
// within a library. The API is the same as before with 1 minor change.
// Instead of m.class_("foo") you instead do
// m.class_(TORCH_SELECTIVE_CLASS("foo"))
+
+ // De-registers all registrations created with this Library
+ public native void reset();
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/LongSmallVectorImpl.java b/pytorch/src/gen/java/org/bytedeco/pytorch/LongSmallVectorImpl.java
index 0854b6d714f..fe099d243b2 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/LongSmallVectorImpl.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/LongSmallVectorImpl.java
@@ -39,7 +39,7 @@ public class LongSmallVectorImpl extends LongSmallVectorBase {
public native @Cast("int64_t") long pop_back_val();
- public native void swap(@ByRef LongSmallVectorImpl RHS);
+ public native @NoException(true) void swap(@ByRef LongSmallVectorImpl RHS);
/** Add the specified range to the end of the SmallVector. */
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/MPSHooksInterface.java b/pytorch/src/gen/java/org/bytedeco/pytorch/MPSHooksInterface.java
index 2044cfaa3af..f53deee0912 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/MPSHooksInterface.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/MPSHooksInterface.java
@@ -19,7 +19,7 @@
@Namespace("at") @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
-public class MPSHooksInterface extends Pointer {
+public class MPSHooksInterface extends AcceleratorHooksInterface {
static { Loader.load(); }
/** Default native constructor. */
public MPSHooksInterface() { super((Pointer)null); allocate(); }
@@ -44,8 +44,8 @@ public class MPSHooksInterface extends Pointer {
// Initialize the MPS library state
public native void initMPS();
public native @Cast("bool") boolean hasMPS();
- public native @Cast("bool") boolean isOnMacOS13orNewer(@Cast("unsigned") int minor/*=0*/);
- public native @Cast("bool") boolean isOnMacOS13orNewer();
+ public native @Cast("bool") boolean isOnMacOSorNewer(@Cast("unsigned") int major/*=13*/, @Cast("unsigned") int minor/*=0*/);
+ public native @Cast("bool") boolean isOnMacOSorNewer();
public native @Const @ByRef Generator getDefaultMPSGenerator();
public native Allocator getMPSDeviceAllocator();
public native void deviceSynchronize();
@@ -66,6 +66,6 @@ public class MPSHooksInterface extends Pointer {
public native void synchronizeEvent(@Cast("uint32_t") int event_id);
public native @Cast("bool") boolean queryEvent(@Cast("uint32_t") int event_id);
public native double elapsedTimeOfEvents(@Cast("uint32_t") int start_event_id, @Cast("uint32_t") int end_event_id);
-
+ public native @Cast("bool") boolean hasPrimaryContext(@Cast("c10::DeviceIndex") byte device_index);
// #undef FAIL_MPSHOOKS_FUNC
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/MTIAHooksInterface.java b/pytorch/src/gen/java/org/bytedeco/pytorch/MTIAHooksInterface.java
index 7486498dfe7..6c314249e46 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/MTIAHooksInterface.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/MTIAHooksInterface.java
@@ -19,7 +19,7 @@
@Namespace("at") @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
-public class MTIAHooksInterface extends Pointer {
+public class MTIAHooksInterface extends AcceleratorHooksInterface {
static { Loader.load(); }
/** Default native constructor. */
public MTIAHooksInterface() { super((Pointer)null); allocate(); }
@@ -42,4 +42,7 @@ public class MTIAHooksInterface extends Pointer {
public native @Cast("bool") boolean hasMTIA();
public native @StdString BytePointer showConfig();
+
+ public native @Cast("bool") boolean hasPrimaryContext(@Cast("c10::DeviceIndex") byte device_index);
+
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/Method.java b/pytorch/src/gen/java/org/bytedeco/pytorch/Method.java
index c8c04f8a1ad..c2d5a49764b 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/Method.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/Method.java
@@ -35,6 +35,9 @@ public class Method extends IMethod {
// the module that contains this method.
public native @ByVal JitModule owner();
+ // the raw objectptr that owns this method, for when the method is owned by a
+ // torchbind object.
+ public native @ByVal @Cast("torch::jit::ObjectPtr*") ObjPtr raw_owner();
public native void run(@ByRef IValueVector stack);
public native @ByVal @Name("operator ()") IValue apply(
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/Module.java b/pytorch/src/gen/java/org/bytedeco/pytorch/Module.java
index 063755fac57..57b4f4903ca 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/Module.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/Module.java
@@ -819,6 +819,11 @@ public native void apply(
///
public native @Name("as") @NoException(true) FractionalMaxPool3dImpl asFractionalMaxPool3d();
+ ///
+ ///
+ ///
+ public native @Name("as") @NoException(true) LPPool3dImpl asLPPool3d();
+
///
///
///
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/NestedTensorImpl.java b/pytorch/src/gen/java/org/bytedeco/pytorch/NestedTensorImpl.java
index d5bda553fad..5ac5cdda20b 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/NestedTensorImpl.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/NestedTensorImpl.java
@@ -40,19 +40,23 @@ private native void allocate(
@ByVal Tensor storage_offsets);
public NestedTensorImpl(
- @ByVal Tensor buffer,
+ @Const @ByRef Tensor buffer,
@ByVal Tensor nested_sizes,
@ByVal Tensor nested_strides,
@ByVal Tensor storage_offsets) { super((Pointer)null); allocate(buffer, nested_sizes, nested_strides, storage_offsets); }
private native void allocate(
- @ByVal Tensor buffer,
+ @Const @ByRef Tensor buffer,
@ByVal Tensor nested_sizes,
@ByVal Tensor nested_strides,
@ByVal Tensor storage_offsets);
// assume contiguous, `nested_strides` and `offsets`
// can be infered from `nested_sizes`
- public NestedTensorImpl(@ByVal Tensor buffer, @ByVal Tensor nested_sizes) { super((Pointer)null); allocate(buffer, nested_sizes); }
- private native void allocate(@ByVal Tensor buffer, @ByVal Tensor nested_sizes);
+ public NestedTensorImpl(
+ @Const @ByRef Tensor buffer,
+ @Const @ByRef Tensor nested_sizes) { super((Pointer)null); allocate(buffer, nested_sizes); }
+ private native void allocate(
+ @Const @ByRef Tensor buffer,
+ @Const @ByRef Tensor nested_sizes);
// This constructor is used creating view tensors from nested tensors
public NestedTensorImpl(
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/Node.java b/pytorch/src/gen/java/org/bytedeco/pytorch/Node.java
index 2f95bdc593d..1e5d82a6afc 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/Node.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/Node.java
@@ -25,7 +25,7 @@
// or more input `Variable`s and producing zero or more output `Variable`s. All
// functions in PyTorch's autograd machinery derive from this class and
// override its `apply` method. Instances of such subclasses will then be
-// invokeable via the call operator.
+// invokable via the call operator.
//
// Nodes in the Autograd Graph
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -127,8 +127,7 @@ public class Node extends Pointer {
* elements are on different devices (across multiple GPUs, for example)
* they may have different streams.
*/
- public native @ByVal StreamOptional stream(DeviceType device_type);
- public native @ByVal StreamOptional stream(@Cast("c10::DeviceType") byte device_type);
+ public native @ByVal StreamOptional stream();
public native void clear_input_metadata();
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/ObjPtr.java b/pytorch/src/gen/java/org/bytedeco/pytorch/ObjPtr.java
index 9fa6a8d2d33..5e99b8a7a68 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/ObjPtr.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/ObjPtr.java
@@ -53,6 +53,10 @@ public class ObjPtr extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) ObjPtr put(@ByRef(true) ObjPtr rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) Object get();
public native @ByRef @Name("operator *") @NoException(true) Object multiply();
@@ -68,9 +72,9 @@ public class ObjPtr extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class ObjPtr extends Pointer {
*/
public static native @ByVal ObjPtr unsafe_adapt_non_heap_allocated(
Object raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/OperandInfo.java b/pytorch/src/gen/java/org/bytedeco/pytorch/OperandInfo.java
index 053afe6bfb7..2e02db50df5 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/OperandInfo.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/OperandInfo.java
@@ -74,6 +74,8 @@ public class OperandInfo extends Pointer {
public native @Cast("bool") boolean is_read_write(); public native OperandInfo is_read_write(boolean setter);
+ public native @Cast("bool") boolean is_const(); public native OperandInfo is_const(boolean setter);
+
public native void validate();
/** The tensor operand. Note that the strides, data pointer, and
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/OptimizerParamState.java b/pytorch/src/gen/java/org/bytedeco/pytorch/OptimizerParamState.java
index d0ae5d9353a..6d1c1350059 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/OptimizerParamState.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/OptimizerParamState.java
@@ -16,7 +16,10 @@
import static org.bytedeco.openblas.global.openblas.*;
import static org.bytedeco.pytorch.global.torch.*;
- // namespace torch
+
+
+// Forward declarations confuse Doxygen
+// #ifndef DOXYGEN_SHOULD_SKIP_THIS
// #endif // DOXYGEN_SHOULD_SKIP_THIS
@Namespace("torch::optim") @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/PlacementDeleteContext.java b/pytorch/src/gen/java/org/bytedeco/pytorch/PlacementDeleteContext.java
index 991c61bca49..0ce81f3f9ff 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/PlacementDeleteContext.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/PlacementDeleteContext.java
@@ -33,19 +33,19 @@ public class PlacementDeleteContext extends Pointer {
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public PlacementDeleteContext(Pointer p) { super(p); }
- public native @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr_(); public native PlacementDeleteContext data_ptr_(DataPtr setter);
+ public native @StdMove DataPtr data_ptr_(); public native PlacementDeleteContext data_ptr_(DataPtr setter);
public native PlacementConsumer placement_dtor_(); public native PlacementDeleteContext placement_dtor_(PlacementConsumer setter);
public native @Cast("size_t") long size_(); public native PlacementDeleteContext size_(long setter);
public PlacementDeleteContext(
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr,
+ @StdMove DataPtr data_ptr,
PlacementConsumer placement_dtor,
@Cast("size_t") long size) { super((Pointer)null); allocate(data_ptr, placement_dtor, size); }
private native void allocate(
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr,
+ @StdMove DataPtr data_ptr,
PlacementConsumer placement_dtor,
@Cast("size_t") long size);
- public static native @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr makeDataPtr(
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr,
+ public static native @StdMove DataPtr makeDataPtr(
+ @StdMove DataPtr data_ptr,
PlacementConsumer placement_dtor,
@Cast("size_t") long size,
@ByVal Device device);
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/PostAccumulateGradHook.java b/pytorch/src/gen/java/org/bytedeco/pytorch/PostAccumulateGradHook.java
index 7159d95e57a..2e4e9de3363 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/PostAccumulateGradHook.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/PostAccumulateGradHook.java
@@ -24,12 +24,12 @@ public class PostAccumulateGradHook extends Pointer {
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public PostAccumulateGradHook(Pointer p) { super(p); }
- public native @Name("operator ()") void apply(@Cast("const torch::autograd::Variable*") @ByRef Tensor tensor);
+ public native @Name("operator ()") void apply(@Const @ByRef Tensor tensor);
// only implemented for python hooks on nodes, registers hook with compiled
// autograd
public native void compiled_args(@ByRef CompiledNodeArgs args);
public native void apply_with_saved(
- @Cast("torch::autograd::Variable*") @ByRef Tensor arg0,
+ @ByRef Tensor arg0,
@ByRef SwapSavedVariables arg1);
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/PrivateUse1HooksInterface.java b/pytorch/src/gen/java/org/bytedeco/pytorch/PrivateUse1HooksInterface.java
index 77289c3c8ae..a5c4e290442 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/PrivateUse1HooksInterface.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/PrivateUse1HooksInterface.java
@@ -19,7 +19,7 @@
@Namespace("at") @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
-public class PrivateUse1HooksInterface extends Pointer {
+public class PrivateUse1HooksInterface extends AcceleratorHooksInterface {
static { Loader.load(); }
/** Default native constructor. */
public PrivateUse1HooksInterface() { super((Pointer)null); allocate(); }
@@ -36,7 +36,15 @@ public class PrivateUse1HooksInterface extends Pointer {
return new PrivateUse1HooksInterface((Pointer)this).offsetAddress(i);
}
- public native @Const @ByRef Generator getDefaultGenerator(@Cast("c10::DeviceIndex") byte device_index);
+ public native @Const @ByRef Generator getDefaultGenerator(
+ @Cast("c10::DeviceIndex") byte device_index);
public native @ByVal Device getDeviceFromPtr(Pointer data);
+
+ public native Allocator getPinnedMemoryAllocator();
+
+ public native @Cast("bool") boolean hasPrimaryContext(@Cast("c10::DeviceIndex") byte device_index);
+
+ public native void initPrivateUse1();
+ public native void resizePrivateUse1Bytes(@Const @ByRef Storage storage, @Cast("size_t") long newsize);
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/PyObjectHolderPtr.java b/pytorch/src/gen/java/org/bytedeco/pytorch/PyObjectHolderPtr.java
index 80491b17fd2..3c6e5c71da5 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/PyObjectHolderPtr.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/PyObjectHolderPtr.java
@@ -53,6 +53,10 @@ public class PyObjectHolderPtr extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) PyObjectHolderPtr put(@ByRef(true) PyObjectHolderPtr rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) PyObjectHolder get();
public native @ByRef @Name("operator *") @NoException(true) PyObjectHolder multiply();
@@ -68,9 +72,9 @@ public class PyObjectHolderPtr extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class PyObjectHolderPtr extends Pointer {
*/
public static native @ByVal PyObjectHolderPtr unsafe_adapt_non_heap_allocated(
PyObjectHolder raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/QuantizerPtr.java b/pytorch/src/gen/java/org/bytedeco/pytorch/QuantizerPtr.java
index e90a7ec2907..fa1f8539ca3 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/QuantizerPtr.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/QuantizerPtr.java
@@ -53,6 +53,10 @@ public class QuantizerPtr extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) QuantizerPtr put(@ByRef(true) QuantizerPtr rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) Quantizer get();
public native @ByRef @Name("operator *") @NoException(true) Quantizer multiply();
@@ -68,9 +72,9 @@ public class QuantizerPtr extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class QuantizerPtr extends Pointer {
*/
public static native @ByVal QuantizerPtr unsafe_adapt_non_heap_allocated(
Quantizer raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/ROCmBackwardPassGuard.java b/pytorch/src/gen/java/org/bytedeco/pytorch/ROCmBackwardPassGuard.java
new file mode 100644
index 00000000000..be8c1517090
--- /dev/null
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/ROCmBackwardPassGuard.java
@@ -0,0 +1,39 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.pytorch;
+
+import org.bytedeco.pytorch.Allocator;
+import org.bytedeco.pytorch.Function;
+import org.bytedeco.pytorch.functions.*;
+import org.bytedeco.pytorch.Module;
+import org.bytedeco.javacpp.annotation.Cast;
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+import static org.bytedeco.openblas.global.openblas_nolapack.*;
+import static org.bytedeco.openblas.global.openblas.*;
+
+import static org.bytedeco.pytorch.global.torch.*;
+
+
+@Namespace("at") @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
+public class ROCmBackwardPassGuard extends Pointer {
+ static { Loader.load(); }
+ /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+ public ROCmBackwardPassGuard(Pointer p) { super(p); }
+ /** Native array allocator. Access with {@link Pointer#position(long)}. */
+ public ROCmBackwardPassGuard(long size) { super((Pointer)null); allocateArray(size); }
+ private native void allocateArray(long size);
+ @Override public ROCmBackwardPassGuard position(long position) {
+ return (ROCmBackwardPassGuard)super.position(position);
+ }
+ @Override public ROCmBackwardPassGuard getPointer(long i) {
+ return new ROCmBackwardPassGuard((Pointer)this).offsetAddress(i);
+ }
+
+ public ROCmBackwardPassGuard() { super((Pointer)null); allocate(); }
+ private native void allocate();
+ public static native @Cast("bool") boolean is_backward_pass();
+}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/RRefInterfacePtr.java b/pytorch/src/gen/java/org/bytedeco/pytorch/RRefInterfacePtr.java
index 487eb30858a..4a230f04d3c 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/RRefInterfacePtr.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/RRefInterfacePtr.java
@@ -53,6 +53,10 @@ public class RRefInterfacePtr extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) RRefInterfacePtr put(@ByRef(true) RRefInterfacePtr rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) RRefInterface get();
public native @ByRef @Name("operator *") @NoException(true) RRefInterface multiply();
@@ -68,9 +72,9 @@ public class RRefInterfacePtr extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class RRefInterfacePtr extends Pointer {
*/
public static native @ByVal RRefInterfacePtr unsafe_adapt_non_heap_allocated(
RRefInterface raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/RecordFunctionCallbacksEntry.java b/pytorch/src/gen/java/org/bytedeco/pytorch/RecordFunctionCallbacksEntry.java
index 77034bfa6ce..a82b1646554 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/RecordFunctionCallbacksEntry.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/RecordFunctionCallbacksEntry.java
@@ -27,8 +27,8 @@ public class RecordFunctionCallbacksEntry extends Pointer {
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public RecordFunctionCallbacksEntry(Pointer p) { super(p); }
- public RecordFunctionCallbacksEntry(@Cast("at::RecordFunctionCallback*") @ByRef(true) Pointer cb, @Cast("at::CallbackHandle") long h) { super((Pointer)null); allocate(cb, h); }
- private native void allocate(@Cast("at::RecordFunctionCallback*") @ByRef(true) Pointer cb, @Cast("at::CallbackHandle") long h);
+ public RecordFunctionCallbacksEntry(@ByVal @Cast("at::RecordFunctionCallback*") Pointer cb, @Cast("at::CallbackHandle") long h) { super((Pointer)null); allocate(cb, h); }
+ private native void allocate(@ByVal @Cast("at::RecordFunctionCallback*") Pointer cb, @Cast("at::CallbackHandle") long h);
public native @ByRef @Cast("at::RecordFunctionCallback*") Pointer callback_(); public native RecordFunctionCallbacksEntry callback_(Pointer setter);
public native @Cast("bool") boolean enabled_(); public native RecordFunctionCallbacksEntry enabled_(boolean setter);
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/Scalar.java b/pytorch/src/gen/java/org/bytedeco/pytorch/Scalar.java
index f9c108d5216..ff1e5629149 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/Scalar.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/Scalar.java
@@ -80,6 +80,15 @@ public class Scalar extends Pointer {
public Scalar(@ByVal DoubleComplex vv) { super((Pointer)null); allocate(vv); }
private native void allocate(@ByVal DoubleComplex vv);
+ // Helper constructors to allow Scalar creation from long and long long types
+ // As std::is_same_v is false(except Android), one needs to
+ // provide a constructor from either long or long long in addition to one from
+ // int64_t
+// #if defined(__APPLE__) || defined(__MACOSX)
+// #endif
+// #if defined(__linux__) && !defined(__ANDROID__)
+// #endif
+
// #undef DEFINE_IMPLICIT_CTOR
// Value* is both implicitly convertible to SymbolicVariable and bool which
@@ -97,6 +106,8 @@ public class Scalar extends Pointer {
// return checked_convert(v.i, #type);
// } else if (Tag::HAS_i == tag) {
// return checked_convert(v.i, #type);
+// } else if (Tag::HAS_u == tag) {
+// return checked_convert(v., #type);
// } else if (Tag::HAS_si == tag) {
// return checked_convert(
// toSymInt().guard_int(__FILE__, __LINE__), #type);
@@ -128,6 +139,9 @@ public class Scalar extends Pointer {
public native @ByVal Float8_e4m3fn toFloat8_e4m3fn();
public native @ByVal Float8_e5m2fnuz toFloat8_e5m2fnuz();
public native @ByVal Float8_e4m3fnuz toFloat8_e4m3fnuz();
+ public native @Cast("uint16_t") short toUInt16();
+ public native @Cast("uint32_t") int toUInt32();
+ public native @Cast("uint64_t") long toUInt64();
// #undef DEFINE_ACCESSOR
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/SequentialImpl.java b/pytorch/src/gen/java/org/bytedeco/pytorch/SequentialImpl.java
index 329dab60ef1..0dd66bed09f 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/SequentialImpl.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/SequentialImpl.java
@@ -256,6 +256,7 @@ public SequentialImpl(
public native @Name("push_back") void push_back(@SharedPtr AdaptiveMaxPool3dImpl module_ptr);
public native @Name("push_back") void push_back(@SharedPtr MaxUnpool3dImpl module_ptr);
public native @Name("push_back") void push_back(@SharedPtr FractionalMaxPool3dImpl module_ptr);
+ public native @Name("push_back") void push_back(@SharedPtr LPPool3dImpl module_ptr);
public native @Name("push_back") void push_back(@SharedPtr RNNImpl module_ptr);
public native @Name("push_back") void push_back(@SharedPtr LSTMImpl module_ptr);
public native @Name("push_back") void push_back(@SharedPtr GRUImpl module_ptr);
@@ -463,6 +464,8 @@ public SequentialImpl(
public native @Name("push_back") void push_back(@StdString String name, @SharedPtr MaxUnpool3dImpl module_ptr);
public native @Name("push_back") void push_back(@StdString BytePointer name, @SharedPtr FractionalMaxPool3dImpl module_ptr);
public native @Name("push_back") void push_back(@StdString String name, @SharedPtr FractionalMaxPool3dImpl module_ptr);
+ public native @Name("push_back") void push_back(@StdString BytePointer name, @SharedPtr LPPool3dImpl module_ptr);
+ public native @Name("push_back") void push_back(@StdString String name, @SharedPtr LPPool3dImpl module_ptr);
public native @Name("push_back") void push_back(@StdString BytePointer name, @SharedPtr RNNImpl module_ptr);
public native @Name("push_back") void push_back(@StdString String name, @SharedPtr RNNImpl module_ptr);
public native @Name("push_back") void push_back(@StdString BytePointer name, @SharedPtr LSTMImpl module_ptr);
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/SizesAndStrides.java b/pytorch/src/gen/java/org/bytedeco/pytorch/SizesAndStrides.java
index fec178b15ab..41e93f17f5b 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/SizesAndStrides.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/SizesAndStrides.java
@@ -45,9 +45,11 @@ public class SizesAndStrides extends Pointer {
// TODO: different iterator types for sizes & strides to prevent
// mixing the two accidentally.
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
public SizesAndStrides() { super((Pointer)null); allocate(); }
private native void allocate();
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
public SizesAndStrides(@Const @ByRef SizesAndStrides rhs) { super((Pointer)null); allocate(rhs); }
private native void allocate(@Const @ByRef SizesAndStrides rhs);
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/Storage.java b/pytorch/src/gen/java/org/bytedeco/pytorch/Storage.java
index 50220dbdd1d..8bdd697a348 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/Storage.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/Storage.java
@@ -65,20 +65,20 @@ public static class unsafe_borrow_t extends Pointer {
// Allocates memory buffer using given allocator and creates a storage with it
public Storage(
@ByVal use_byte_size_t arg0,
- @ByVal SymInt size_bytes,
+ @Const @ByRef SymInt size_bytes,
Allocator allocator/*=nullptr*/,
@Cast("bool") boolean resizable/*=false*/) { super((Pointer)null); allocate(arg0, size_bytes, allocator, resizable); }
private native void allocate(
@ByVal use_byte_size_t arg0,
- @ByVal SymInt size_bytes,
+ @Const @ByRef SymInt size_bytes,
Allocator allocator/*=nullptr*/,
@Cast("bool") boolean resizable/*=false*/);
public Storage(
@ByVal use_byte_size_t arg0,
- @ByVal SymInt size_bytes) { super((Pointer)null); allocate(arg0, size_bytes); }
+ @Const @ByRef SymInt size_bytes) { super((Pointer)null); allocate(arg0, size_bytes); }
private native void allocate(
@ByVal use_byte_size_t arg0,
- @ByVal SymInt size_bytes);
+ @Const @ByRef SymInt size_bytes);
// Creates storage with pre-allocated memory buffer. Allocator is given for
// potential future reallocations, however it can be nullptr if the storage
@@ -86,23 +86,23 @@ private native void allocate(
public Storage(
@ByVal use_byte_size_t arg0,
@Cast("size_t") long size_bytes,
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr,
+ @StdMove DataPtr data_ptr,
Allocator allocator/*=nullptr*/,
@Cast("bool") boolean resizable/*=false*/) { super((Pointer)null); allocate(arg0, size_bytes, data_ptr, allocator, resizable); }
private native void allocate(
@ByVal use_byte_size_t arg0,
@Cast("size_t") long size_bytes,
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr,
+ @StdMove DataPtr data_ptr,
Allocator allocator/*=nullptr*/,
@Cast("bool") boolean resizable/*=false*/);
public Storage(
@ByVal use_byte_size_t arg0,
@Cast("size_t") long size_bytes,
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr) { super((Pointer)null); allocate(arg0, size_bytes, data_ptr); }
+ @StdMove DataPtr data_ptr) { super((Pointer)null); allocate(arg0, size_bytes, data_ptr); }
private native void allocate(
@ByVal use_byte_size_t arg0,
@Cast("size_t") long size_bytes,
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr);
+ @StdMove DataPtr data_ptr);
// Legacy constructor for partially initialized (dtype or memory) storages
// that can be temporarily created with Caffe2 APIs. See the note on top of
// TensorImpl.h for details.
@@ -129,12 +129,12 @@ private native void allocate(
public native @ByRef DataPtr mutable_data_ptr();
- public native @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr();
+ public native @StdMove DataPtr data_ptr();
// Returns the previous data_ptr
- public native @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr set_data_ptr(@Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr);
+ public native @StdMove DataPtr set_data_ptr(@StdMove DataPtr data_ptr);
- public native void set_data_ptr_noswap(@Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr);
+ public native void set_data_ptr_noswap(@StdMove DataPtr data_ptr);
public native DeviceType device_type();
@@ -164,7 +164,5 @@ public native void UniqueStorageShareExternalPointer(
Pointer src,
@Cast("size_t") long _capacity);
- public native void UniqueStorageShareExternalPointer(
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr,
- @Cast("size_t") long _capacity);
+ public native void UniqueStorageShareExternalPointer(@Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr, @Cast("size_t") long size_bytes);
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/StorageImpl.java b/pytorch/src/gen/java/org/bytedeco/pytorch/StorageImpl.java
index a0832d8183d..08dcc314221 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/StorageImpl.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/StorageImpl.java
@@ -57,13 +57,13 @@ public class StorageImpl extends Pointer {
public StorageImpl(
@ByVal use_byte_size_t arg0,
@ByVal SymInt size_bytes,
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr,
+ @StdMove DataPtr data_ptr,
Allocator allocator,
@Cast("bool") boolean resizable) { super((Pointer)null); allocate(arg0, size_bytes, data_ptr, allocator, resizable); }
private native void allocate(
@ByVal use_byte_size_t arg0,
@ByVal SymInt size_bytes,
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr,
+ @StdMove DataPtr data_ptr,
Allocator allocator,
@Cast("bool") boolean resizable);
@@ -103,12 +103,12 @@ private native void allocate(
public native @ByRef DataPtr mutable_data_ptr();
- public native @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr();
+ public native @StdMove DataPtr data_ptr();
// Returns the previous data_ptr
- public native @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr set_data_ptr(@Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr);
+ public native @StdMove DataPtr set_data_ptr(@StdMove DataPtr data_ptr);
- public native void set_data_ptr_noswap(@Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr);
+ public native void set_data_ptr_noswap(@StdMove DataPtr data_ptr);
public native @Const Pointer data();
@@ -142,9 +142,7 @@ public native void UniqueStorageShareExternalPointer(
/**
* Can only be called when use_count is 1
*/
- public native void UniqueStorageShareExternalPointer(
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr,
- @Cast("size_t") long size_bytes);
+ public native void UniqueStorageShareExternalPointer(@Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr, @Cast("size_t") long size_bytes);
// This method can be used only after storage construction and cannot be used
// to modify storage status
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/StorageImplPtr.java b/pytorch/src/gen/java/org/bytedeco/pytorch/StorageImplPtr.java
index 38d5937fdcb..777055f6ad6 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/StorageImplPtr.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/StorageImplPtr.java
@@ -53,6 +53,10 @@ public class StorageImplPtr extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) StorageImplPtr put(@ByRef(true) StorageImplPtr rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) StorageImpl get();
public native @ByRef @Name("operator *") @NoException(true) StorageImpl multiply();
@@ -68,9 +72,9 @@ public class StorageImplPtr extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class StorageImplPtr extends Pointer {
*/
public static native @ByVal StorageImplPtr unsafe_adapt_non_heap_allocated(
StorageImpl raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/StringIntMap.java b/pytorch/src/gen/java/org/bytedeco/pytorch/StringIntMap.java
new file mode 100644
index 00000000000..06c99b20c37
--- /dev/null
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/StringIntMap.java
@@ -0,0 +1,48 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.pytorch;
+
+import org.bytedeco.pytorch.Allocator;
+import org.bytedeco.pytorch.Function;
+import org.bytedeco.pytorch.functions.*;
+import org.bytedeco.pytorch.Module;
+import org.bytedeco.javacpp.annotation.Cast;
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+import static org.bytedeco.openblas.global.openblas_nolapack.*;
+import static org.bytedeco.openblas.global.openblas.*;
+
+import static org.bytedeco.pytorch.global.torch.*;
+
+@Name("std::unordered_map") @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
+public class StringIntMap extends Pointer {
+ static { Loader.load(); }
+ /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+ public StringIntMap(Pointer p) { super(p); }
+ public StringIntMap() { allocate(); }
+ private native void allocate();
+ public native @Name("operator =") @ByRef StringIntMap put(@ByRef StringIntMap x);
+
+ public boolean empty() { return size() == 0; }
+ public native long size();
+
+ @Index public native int get(@StdString BytePointer i);
+ public native StringIntMap put(@StdString BytePointer i, int value);
+
+ public native void erase(@ByVal Iterator pos);
+ public native @ByVal Iterator begin();
+ public native @ByVal Iterator end();
+ @NoOffset @Name("iterator") public static class Iterator extends Pointer {
+ public Iterator(Pointer p) { super(p); }
+ public Iterator() { }
+
+ public native @Name("operator ++") @ByRef Iterator increment();
+ public native @Name("operator ==") boolean equals(@ByRef Iterator it);
+ public native @Name("operator *().first") @MemberGetter @StdString BytePointer first();
+ public native @Name("operator *().second") @MemberGetter int second();
+ }
+}
+
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/SymBool.java b/pytorch/src/gen/java/org/bytedeco/pytorch/SymBool.java
index 7f281dd3ea2..3a2aeea918d 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/SymBool.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/SymBool.java
@@ -67,6 +67,8 @@ public class SymBool extends Pointer {
public native @Cast("bool") boolean guard_bool(String file, @Cast("int64_t") long line);
public native @Cast("bool") boolean expect_true(@Cast("const char*") BytePointer file, @Cast("int64_t") long line);
public native @Cast("bool") boolean expect_true(String file, @Cast("int64_t") long line);
+ public native @Cast("bool") boolean guard_size_oblivious(@Cast("const char*") BytePointer file, @Cast("int64_t") long line);
+ public native @Cast("bool") boolean guard_size_oblivious(String file, @Cast("int64_t") long line);
public native @Cast("bool") boolean has_hint();
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/SymIntSmallVectorImpl.java b/pytorch/src/gen/java/org/bytedeco/pytorch/SymIntSmallVectorImpl.java
index 5a4ece68c12..373f2a582b2 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/SymIntSmallVectorImpl.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/SymIntSmallVectorImpl.java
@@ -42,7 +42,7 @@ public class SymIntSmallVectorImpl extends SymIntSmallVectorBase {
public native @ByVal SymInt pop_back_val();
- public native void swap(@ByRef SymIntSmallVectorImpl RHS);
+ public native @NoException(true) void swap(@ByRef SymIntSmallVectorImpl RHS);
/** Add the specified range to the end of the SmallVector. */
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/SymNode.java b/pytorch/src/gen/java/org/bytedeco/pytorch/SymNode.java
index 3e7d3f7dd21..8f9b11012c7 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/SymNode.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/SymNode.java
@@ -53,6 +53,10 @@ public class SymNode extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) SymNode put(@ByRef(true) SymNode rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) SymNodeImpl get();
public native @ByRef @Name("operator *") @NoException(true) SymNodeImpl multiply();
@@ -68,9 +72,9 @@ public class SymNode extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class SymNode extends Pointer {
*/
public static native @ByVal SymNode unsafe_adapt_non_heap_allocated(
SymNodeImpl raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/SymNodeImpl.java b/pytorch/src/gen/java/org/bytedeco/pytorch/SymNodeImpl.java
index 3da1ca11317..c10e46fd3f6 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/SymNodeImpl.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/SymNodeImpl.java
@@ -45,6 +45,7 @@ public class SymNodeImpl extends Pointer {
public native @Cast("bool") boolean is_int();
public native @Cast("bool") boolean is_bool();
public native @Cast("bool") boolean is_float();
+ public native @Cast("bool") boolean is_nested_int();
public native @ByVal SymNode add(@Const @ByRef SymNode other);
public native @ByVal SymNode sub(@Const @ByRef SymNode other);
public native @ByVal SymNode mul(@Const @ByRef SymNode other);
@@ -97,6 +98,8 @@ public class SymNodeImpl extends Pointer {
public native @Cast("bool") boolean guard_bool(String file, @Cast("int64_t") long line);
public native double guard_float(@Cast("const char*") BytePointer file, @Cast("int64_t") long line);
public native double guard_float(String file, @Cast("int64_t") long line);
+ public native @Cast("bool") boolean guard_size_oblivious(@Cast("const char*") BytePointer file, @Cast("int64_t") long line);
+ public native @Cast("bool") boolean guard_size_oblivious(String file, @Cast("int64_t") long line);
public native @Cast("bool") boolean expect_true(@Cast("const char*") BytePointer file, @Cast("int64_t") long line);
public native @Cast("bool") boolean expect_true(String file, @Cast("int64_t") long line);
public native @Cast("bool") boolean expect_size(@Cast("const char*") BytePointer file, @Cast("int64_t") long line);
@@ -105,8 +108,8 @@ public class SymNodeImpl extends Pointer {
public native @Cast("bool") boolean bool_();
public native @Cast("bool") boolean has_hint();
public native @StdString BytePointer str();
- public native @ByVal LongOptional singleton_int();
- public native @ByVal LongOptional singleton_coeff();
+ public native @ByVal LongOptional nested_int();
+ public native @ByVal LongOptional nested_int_coeff();
public native @ByVal LongOptional constant_int();
public native @ByVal BoolOptional constant_bool();
public native @ByVal LongOptional maybe_as_int();
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/T_DataPtrSizeT_T.java b/pytorch/src/gen/java/org/bytedeco/pytorch/T_DataPtrSizeT_T.java
index b7a301a1f5d..095c067bae1 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/T_DataPtrSizeT_T.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/T_DataPtrSizeT_T.java
@@ -26,8 +26,8 @@ public class T_DataPtrSizeT_T extends Pointer {
private native void allocate();
- public @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr get0() { return get0(this); }
- @Namespace @Name("std::get<0>") public static native @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr get0(@ByRef T_DataPtrSizeT_T container);
+ public @StdMove DataPtr get0() { return get0(this); }
+ @Namespace @Name("std::get<0>") public static native @StdMove DataPtr get0(@ByRef T_DataPtrSizeT_T container);
public @Cast("size_t") long get1() { return get1(this); }
@Namespace @Name("std::get<1>") public static native @Cast("size_t") long get1(@ByRef T_DataPtrSizeT_T container);
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/Tensor.java b/pytorch/src/gen/java/org/bytedeco/pytorch/Tensor.java
index f7cbc6eba3d..47faee6e12e 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/Tensor.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/Tensor.java
@@ -489,6 +489,7 @@ private native void allocate(
public native @ByRef Tensor copysign_(@Const @ByRef Tensor other);
public native @ByVal Tensor copysign(@Const @ByRef Scalar other);
public native @ByRef Tensor copysign_(@Const @ByRef Scalar other);
+ public native @ByVal Tensor _lazy_clone();
public native @ByVal Tensor logical_not();
public native @ByRef Tensor logical_not_();
public native @ByVal Tensor logical_xor(@Const @ByRef Tensor other);
@@ -915,6 +916,10 @@ private native void allocate(
public native @ByVal Tensor slice();
public native @ByVal Tensor slice_symint(@Cast("int64_t") long dim/*=0*/, @ByVal(nullValue = "c10::optional(c10::nullopt)") SymIntOptional start, @ByVal(nullValue = "c10::optional(c10::nullopt)") SymIntOptional end, @ByVal(nullValue = "c10::SymInt(1)") SymInt step);
public native @ByVal Tensor slice_symint();
+ public native @ByVal Tensor slice_inverse(@Const @ByRef Tensor src, @Cast("int64_t") long dim/*=0*/, @ByVal(nullValue = "c10::optional(c10::nullopt)") LongOptional start, @ByVal(nullValue = "c10::optional(c10::nullopt)") LongOptional end, @Cast("int64_t") long step/*=1*/);
+ public native @ByVal Tensor slice_inverse(@Const @ByRef Tensor src);
+ public native @ByVal Tensor slice_inverse_symint(@Const @ByRef Tensor src, @Cast("int64_t") long dim/*=0*/, @ByVal(nullValue = "c10::optional(c10::nullopt)") SymIntOptional start, @ByVal(nullValue = "c10::optional(c10::nullopt)") SymIntOptional end, @ByVal(nullValue = "c10::SymInt(1)") SymInt step);
+ public native @ByVal Tensor slice_inverse_symint(@Const @ByRef Tensor src);
public native @ByVal Tensor slice_scatter(@Const @ByRef Tensor src, @Cast("int64_t") long dim/*=0*/, @ByVal(nullValue = "c10::optional(c10::nullopt)") LongOptional start, @ByVal(nullValue = "c10::optional(c10::nullopt)") LongOptional end, @Cast("int64_t") long step/*=1*/);
public native @ByVal Tensor slice_scatter(@Const @ByRef Tensor src);
public native @ByVal Tensor slice_scatter_symint(@Const @ByRef Tensor src, @Cast("int64_t") long dim/*=0*/, @ByVal(nullValue = "c10::optional(c10::nullopt)") SymIntOptional start, @ByVal(nullValue = "c10::optional(c10::nullopt)") SymIntOptional end, @ByVal(nullValue = "c10::SymInt(1)") SymInt step);
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorArg.java b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorArg.java
index c67e4e97f25..4c973e312e4 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorArg.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorArg.java
@@ -28,6 +28,7 @@ public class TensorArg extends Pointer {
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public TensorArg(Pointer p) { super(p); }
+ // NOLINTNEXTLINE(cppcoreguidelines-avoid-const-or-ref-data-members)
@MemberGetter public native @Const @ByRef Tensor tensor();
public native @Cast("const char*") BytePointer name(); public native TensorArg name(BytePointer setter);
public native int pos(); public native TensorArg pos(int setter); // 1-indexed
@@ -36,6 +37,7 @@ public class TensorArg extends Pointer {
public TensorArg(@Const @ByRef Tensor tensor, String name, int pos) { super((Pointer)null); allocate(tensor, name, pos); }
private native void allocate(@Const @ByRef Tensor tensor, String name, int pos);
// Try to mitigate any possibility of dangling reference to temporaries.
+ // NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
public native @Const @Name("operator ->") Tensor access();
public native @Const @ByRef @Name("operator *") Tensor multiply();
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorImpl.java b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorImpl.java
index 1996b4d0733..f6b903ec3cd 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorImpl.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorImpl.java
@@ -415,6 +415,9 @@ public enum SizesStridesPolicy {
// Whether a tensor is sparse CSR or not.
public native @Cast("bool") boolean is_sparse_csr();
+ // Whether a tensor is sparse CSR/CSC/BSR/BSC or not.
+ public native @Cast("bool") boolean is_sparse_compressed();
+
public native @Cast("bool") boolean is_quantized();
public native @Cast("bool") boolean is_meta();
@@ -465,7 +468,7 @@ public enum SizesStridesPolicy {
// Inference tensor has version_counter_.enabled() == false
public native @Cast("bool") boolean is_inference();
- public native @Cast("int64_t") long get_device();
+ public native @Cast("c10::DeviceIndex") byte get_device();
public native @ByVal Device device();
public native Layout layout();
@@ -956,7 +959,7 @@ public native void set_named_tensor_meta(
public native void ShareData(@Const @ByRef TensorImpl src);
public native void ShareExternalPointer(
- @Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr data_ptr,
+ @StdMove DataPtr data_ptr,
@Const @ByVal TypeMeta data_type,
@Cast("size_t") long size_bytes);
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorImplPtr.java b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorImplPtr.java
index 0eae33a9c78..1292b6f9bf3 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorImplPtr.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorImplPtr.java
@@ -53,6 +53,10 @@ public class TensorImplPtr extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) TensorImplPtr put(@ByRef(true) TensorImplPtr rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) TensorImpl get();
public native @ByRef @Name("operator *") @NoException(true) TensorImpl multiply();
@@ -68,9 +72,9 @@ public class TensorImplPtr extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class TensorImplPtr extends Pointer {
*/
public static native @ByVal TensorImplPtr unsafe_adapt_non_heap_allocated(
TensorImpl raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorIteratorBase.java b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorIteratorBase.java
index 6e8a4567ca8..5a4dbcd14dc 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorIteratorBase.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorIteratorBase.java
@@ -61,33 +61,33 @@ public class TensorIteratorBase extends MetaBase {
public native @Cast("bool") boolean is_dim_reduced(int dim);
/** Accessors for each operand */
- public native @ByVal LongArrayRef strides(int arg);
- public native Pointer data_ptr(int arg);
- public native ScalarType dtype(int arg/*=0*/);
+ public native @ByVal LongArrayRef strides(@Cast("int64_t") long arg);
+ public native Pointer data_ptr(@Cast("int64_t") long arg);
+ public native ScalarType dtype(@Cast("int64_t") long arg/*=0*/);
public native ScalarType dtype();
public native ScalarType common_dtype();
- public native ScalarType input_dtype(int arg/*=0*/);
+ public native ScalarType input_dtype(@Cast("int64_t") long arg/*=0*/);
public native ScalarType input_dtype();
- public native @ByVal Device device(int arg/*=0*/);
+ public native @ByVal Device device(@Cast("int64_t") long arg/*=0*/);
public native @ByVal Device device();
- public native DeviceType device_type(int arg/*=0*/);
+ public native DeviceType device_type(@Cast("int64_t") long arg/*=0*/);
public native DeviceType device_type();
- public native @Cast("int64_t") long element_size(int arg);
- public native @Cast("bool") boolean is_scalar(int arg);
- public native @Cast("bool") boolean is_cpu_scalar(int arg);
+ public native @Cast("int64_t") long element_size(@Cast("int64_t") long arg);
+ public native @Cast("bool") boolean is_scalar(@Cast("int64_t") long arg);
+ public native @Cast("bool") boolean is_cpu_scalar(@Cast("int64_t") long arg);
- public native @Const @ByRef TensorBase tensor_base(int arg);
- public native @Const @ByRef Tensor tensor(int arg);
+ public native @Const @ByRef TensorBase tensor_base(@Cast("int64_t") long arg);
+ public native @Const @ByRef Tensor tensor(@Cast("int64_t") long arg);
- public native @Const @ByRef TensorBase output_base(int arg/*=0*/);
+ public native @Const @ByRef TensorBase output_base(@Cast("int64_t") long arg/*=0*/);
public native @Const @ByRef TensorBase output_base();
- public native @Const @ByRef Tensor output(int arg/*=0*/);
+ public native @Const @ByRef Tensor output(@Cast("int64_t") long arg/*=0*/);
public native @Const @ByRef Tensor output();
- public native @Const @ByRef TensorBase input_base(int arg/*=0*/);
+ public native @Const @ByRef TensorBase input_base(@Cast("int64_t") long arg/*=0*/);
public native @Const @ByRef TensorBase input_base();
- public native @Const @ByRef Tensor input(int arg/*=0*/);
+ public native @Const @ByRef Tensor input(@Cast("int64_t") long arg/*=0*/);
public native @Const @ByRef Tensor input();
// Copies from temporary outputs back to the original outputs
@@ -95,7 +95,7 @@ public class TensorIteratorBase extends MetaBase {
public native void cast_outputs();
/** Removes an operand from this iterator */
- public native void remove_operand(int arg);
+ public native void remove_operand(@Cast("int64_t") long arg);
/** Shrinks an iterated dimension */
public native void narrow(int dim, @Cast("int64_t") long start, @Cast("int64_t") long size);
/** Narrows every dim after and including {@code start_dim} to size one. */
@@ -104,7 +104,7 @@ public class TensorIteratorBase extends MetaBase {
/** Replaces the data pointer for the operand at index {@code arg}.
* The new pointer should have the same sizes, strides and dtype as the
* original */
- public native void unsafe_replace_operand(int arg, Pointer data);
+ public native void unsafe_replace_operand(@Cast("int64_t") long arg, Pointer data);
/** Splits this TensorIterator into two iterators. Together they iterate over
* the entire operation. Used by {@code with_32bit_indexing()}. */
@@ -130,7 +130,7 @@ public class TensorIteratorBase extends MetaBase {
/** Create a strides array for a Tensor with shape of this iterator. The
* parameter {@code element_size} specifies the size of Tensor's data type in
* bytes (e.g. {@code 4} for {@code float}) */
- public native @ByVal @Cast("at::TensorIteratorBase::StrideVector*") SymDimVector compatible_stride(int element_size);
+ public native @ByVal @Cast("at::TensorIteratorBase::StrideVector*") SymDimVector compatible_stride(@Cast("int64_t") long element_size);
/** Inverts the re-ordering done by reorder_dimensions. This can only be
* called *before* coalesce_dimensions() is called. */
@@ -148,9 +148,9 @@ public class TensorIteratorBase extends MetaBase {
public native @ByVal @Cast("at::TensorIteratorBase::PtrVector*") SymDimVector get_base_ptrs();
// Helper functions for advanced stride manipulations (e.g. torch.flip)
- public native void _unsafe_set_arg_strides(int arg, @ByVal LongArrayRef strides);
- public native void _unsafe_set_arg_strides(int arg, @ByVal @Cast({"int64_t*", "c10::ArrayRef", "std::vector&"}) @StdVector("int64_t") long... strides);
- public native void _unsafe_set_arg_data(int arg, Pointer data);
+ public native void _unsafe_set_arg_strides(@Cast("const int64_t") long arg, @ByVal LongArrayRef strides);
+ public native void _unsafe_set_arg_strides(@Cast("const int64_t") long arg, @ByVal @Cast({"int64_t*", "c10::ArrayRef", "std::vector&"}) @StdVector("int64_t") long... strides);
+ public native void _unsafe_set_arg_data(@Cast("const int64_t") long arg, Pointer data);
/** true if the stride computation can use 32-bit arithmetic. Used by GPU
* kernels */
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorIteratorConfig.java b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorIteratorConfig.java
index 98bf03c4a18..b4311f0b508 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorIteratorConfig.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorIteratorConfig.java
@@ -45,10 +45,12 @@ public class TensorIteratorConfig extends Pointer {
// Important: the outputs have to be added before the inputs.
public native @ByRef TensorIteratorConfig add_output(@Const @ByRef TensorBase output);
public native @ByRef TensorIteratorConfig add_input(@Const @ByRef TensorBase input);
+ public native @ByRef TensorIteratorConfig add_const_input(@Const @ByRef TensorBase input);
// Borrowing from temporaries is unlikely to go well.
+
// Stores input/output Tensors while incrementing the reference count.
// Note that add_{in,out}put are nearly always what you
@@ -56,6 +58,7 @@ public class TensorIteratorConfig extends Pointer {
// compile.
public native @ByRef TensorIteratorConfig add_owned_output(@Const @ByRef TensorBase output);
public native @ByRef TensorIteratorConfig add_owned_input(@Const @ByRef TensorBase input);
+ public native @ByRef TensorIteratorConfig add_owned_const_input(@Const @ByRef TensorBase input);
// Advanced API: stores input/output Tensors without incrementing
// the reference count. The caller must ensure that these Tensors
@@ -64,10 +67,12 @@ public class TensorIteratorConfig extends Pointer {
// Important: the outputs have to be added before the inputs.
public native @ByRef TensorIteratorConfig add_borrowed_output(@Const @ByRef TensorBase output);
public native @ByRef TensorIteratorConfig add_borrowed_input(@Const @ByRef TensorBase input);
+ public native @ByRef TensorIteratorConfig add_borrowed_const_input(@Const @ByRef TensorBase input);
// Borrowing from temporaries is unlikely to go well.
+
// Sets the check_mem_overlap_ flag, which is true by default.
// If true, inputs are checked for partial overlap with the outputs and
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorMaker.java b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorMaker.java
index dfb22fa1529..5a82150042d 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorMaker.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorMaker.java
@@ -25,9 +25,8 @@
*
* at::Tensor tensor = at::for_blob(data, sizes)
* .strides(strides)
- * .context(context, [](void *ctx) { delete static_cast(ctx); })
- * .options(...)
- * .make_tensor();
+ * .context(context, [](void *ctx) { delete static_cast(ctx);
+ * }) .options(...) .make_tensor();
* */
@Namespace("at") @NoOffset @Properties(inherit = org.bytedeco.pytorch.presets.torch.class)
public class TensorMaker extends Pointer {
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorNames.java b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorNames.java
index 5ba13495d98..b94b4f48a69 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorNames.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorNames.java
@@ -49,6 +49,6 @@ public class TensorNames extends Pointer {
public native void checkUnique(@Cast("const char*") BytePointer op_name);
public native void checkUnique(String op_name);
- public native void append(@ByRef(true) TensorName name);
+ public native void append(@ByVal TensorName name);
public native @ByVal DimnameVector toDimnameVec();
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorOptions.java b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorOptions.java
index e46c3e9ddc7..fb3796f2af8 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/TensorOptions.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/TensorOptions.java
@@ -199,7 +199,7 @@ public class TensorOptions extends Pointer {
public native @ByVal @NoException(true) DeviceOptional device_opt();
/** Returns the device index of the {@code TensorOptions}. */
- public native @NoException(true) int device_index();
+ public native @Cast("c10::DeviceIndex") @NoException(true) byte device_index();
/** Returns the dtype of the {@code TensorOptions}. */
public native @ByVal @NoException(true) TypeMeta dtype();
@@ -240,8 +240,12 @@ public class TensorOptions extends Pointer {
/** Returns if the layout is sparse */
public native @Cast("bool") boolean is_sparse();
+ /** Returns if the layout is sparse CSR, deprecated, use
+ * is_sparse_compressed() instead */
public native @Cast("bool") boolean is_sparse_csr();
+ public native @Cast("bool") boolean is_sparse_compressed();
+
// For compatibility with legacy tensor.type() comparisons
public native @Cast("bool") boolean type_equal(@Const @ByRef TensorOptions other);
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/TreeRef.java b/pytorch/src/gen/java/org/bytedeco/pytorch/TreeRef.java
index f65c9a9a987..a827f9811ae 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/TreeRef.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/TreeRef.java
@@ -53,6 +53,10 @@ public class TreeRef extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) TreeRef put(@ByRef(true) TreeRef rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) Tree get();
public native @ByRef @Name("operator *") @NoException(true) Tree multiply();
@@ -68,9 +72,9 @@ public class TreeRef extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class TreeRef extends Pointer {
*/
public static native @ByVal TreeRef unsafe_adapt_non_heap_allocated(
Tree raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/TuplePtr.java b/pytorch/src/gen/java/org/bytedeco/pytorch/TuplePtr.java
index 57480dba941..8cd45265936 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/TuplePtr.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/TuplePtr.java
@@ -53,6 +53,10 @@ public class TuplePtr extends Pointer {
public native @ByRef @Name("operator =") @NoException(true) TuplePtr put(@ByRef(true) TuplePtr rhs);
+ // Assignment is implemented using copy and swap. That's safe for self
+ // assignment.
+ // NOLINTNEXTLINE(bugprone-unhandled-self-assignment)
+
public native @NoException(true) Tuple get();
public native @ByRef @Name("operator *") @NoException(true) Tuple multiply();
@@ -68,9 +72,9 @@ public class TuplePtr extends Pointer {
// We do a lot of null-pointer checks in our code, good to have this be cheap.
public native @Cast("bool") @NoException(true) boolean defined();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean unique();
@@ -134,7 +138,7 @@ public class TuplePtr extends Pointer {
*/
public static native @ByVal TuplePtr unsafe_adapt_non_heap_allocated(
Tuple raw_ptr,
- @Cast("size_t") long expected_decrefs);
+ @Cast("uint32_t") int expected_decrefs);
/**
* Turn a **non-owning raw pointer** to an intrusive_ptr. It is
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/VariableInfo.java b/pytorch/src/gen/java/org/bytedeco/pytorch/VariableInfo.java
index 0b7432be9d4..a7e0b27fc0f 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/VariableInfo.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/VariableInfo.java
@@ -35,10 +35,10 @@ public class VariableInfo extends Pointer {
public VariableInfo() { super((Pointer)null); allocate(); }
private native void allocate();
- public VariableInfo(@Cast("const torch::autograd::Variable*") @ByRef Tensor var) { super((Pointer)null); allocate(var); }
- private native void allocate(@Cast("const torch::autograd::Variable*") @ByRef Tensor var);
+ public VariableInfo(@Const @ByRef Tensor var) { super((Pointer)null); allocate(var); }
+ private native void allocate(@Const @ByRef Tensor var);
- public native @ByVal @Cast("torch::autograd::Variable*") Tensor zeros(@ByRef OptionalDeviceGuard device_guard);
+ public native @ByVal Tensor zeros(@ByRef OptionalDeviceGuard device_guard);
public native @ByRef Layout layout(); public native VariableInfo layout(Layout setter);
public native @ByRef Device device(); public native VariableInfo device(Device setter);
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/WeakStorage.java b/pytorch/src/gen/java/org/bytedeco/pytorch/WeakStorage.java
index 087d4dd4dcc..f0b7bfa9d7c 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/WeakStorage.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/WeakStorage.java
@@ -63,9 +63,9 @@ public class WeakStorage extends Pointer {
//
public native @NoException(true) StorageImpl _unsafe_get_target();
- public native @Cast("size_t") @NoException(true) long use_count();
+ public native @Cast("uint32_t") @NoException(true) int use_count();
- public native @Cast("size_t") @NoException(true) long weak_use_count();
+ public native @Cast("uint32_t") @NoException(true) int weak_use_count();
public native @Cast("bool") @NoException(true) boolean expired();
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/XPUHooksInterface.java b/pytorch/src/gen/java/org/bytedeco/pytorch/XPUHooksInterface.java
index 3d4a031af0f..1fcb4111d48 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/XPUHooksInterface.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/XPUHooksInterface.java
@@ -43,14 +43,7 @@ public class XPUHooksInterface extends Pointer {
public native @StdString BytePointer showConfig();
- public native @ByVal Device getATenDeviceFromDLPackDevice(
- @Const @ByRef DLDevice_ dl_device,
- Pointer data);
-
- public native @ByRef DLDevice_ getDLPackDeviceFromATenDevice(
- @ByRef DLDevice_ dl_device,
- @Const @ByRef Device aten_device,
- Pointer data);
+ public native int getGlobalIdxFromDevice(@Const @ByRef Device device);
public native @ByVal Generator getXPUGenerator(@Cast("c10::DeviceIndex") byte device_index/*=-1*/);
public native @ByVal Generator getXPUGenerator();
@@ -58,5 +51,11 @@ public class XPUHooksInterface extends Pointer {
public native @Const @ByRef Generator getDefaultXPUGenerator(@Cast("c10::DeviceIndex") byte device_index/*=-1*/);
public native @Const @ByRef Generator getDefaultXPUGenerator();
- public native int getNumGPUs();
+ public native @Cast("c10::DeviceIndex") byte getNumGPUs();
+
+ public native @Cast("c10::DeviceIndex") byte current_device();
+
+ public native @ByVal Device getDeviceFromPtr(Pointer arg0);
+
+ public native void deviceSynchronize(@Cast("c10::DeviceIndex") byte arg0);
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/AOTIModelContainerRunnerCuda.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/AOTIModelContainerRunnerCuda.java
new file mode 100644
index 00000000000..b99c61cbf15
--- /dev/null
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/AOTIModelContainerRunnerCuda.java
@@ -0,0 +1,68 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.pytorch.cuda;
+
+import org.bytedeco.pytorch.*;
+import org.bytedeco.pytorch.cuda.functions.*;
+import org.bytedeco.pytorch.Error;
+import org.bytedeco.pytorch.global.torch.DeviceType;
+import org.bytedeco.pytorch.global.torch.ScalarType;
+import org.bytedeco.pytorch.global.torch.MemoryFormat;
+import org.bytedeco.pytorch.Allocator;
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+import static org.bytedeco.openblas.global.openblas_nolapack.*;
+import static org.bytedeco.openblas.global.openblas.*;
+import org.bytedeco.pytorch.*;
+import static org.bytedeco.pytorch.global.torch.*;
+
+import static org.bytedeco.pytorch.global.torch_cuda.*;
+
+
+// NOTICE: Following APIs are subject to change due to active development
+// We provide NO BC guarantee for these APIs
+@Namespace("torch::inductor") @Properties(inherit = org.bytedeco.pytorch.presets.torch_cuda.class)
+public class AOTIModelContainerRunnerCuda extends AOTIModelContainerRunner {
+ static { Loader.load(); }
+ /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+ public AOTIModelContainerRunnerCuda(Pointer p) { super(p); }
+
+ // @param device_str: cuda device string, e.g. "cuda", "cuda:0"
+ public AOTIModelContainerRunnerCuda(
+ @StdString BytePointer model_so_path,
+ @Cast("size_t") long num_models/*=1*/,
+ @StdString BytePointer device_str/*="cuda"*/,
+ @StdString BytePointer cubin_dir/*=""*/) { super((Pointer)null); allocate(model_so_path, num_models, device_str, cubin_dir); }
+ private native void allocate(
+ @StdString BytePointer model_so_path,
+ @Cast("size_t") long num_models/*=1*/,
+ @StdString BytePointer device_str/*="cuda"*/,
+ @StdString BytePointer cubin_dir/*=""*/);
+ public AOTIModelContainerRunnerCuda(
+ @StdString BytePointer model_so_path) { super((Pointer)null); allocate(model_so_path); }
+ private native void allocate(
+ @StdString BytePointer model_so_path);
+ public AOTIModelContainerRunnerCuda(
+ @StdString String model_so_path,
+ @Cast("size_t") long num_models/*=1*/,
+ @StdString String device_str/*="cuda"*/,
+ @StdString String cubin_dir/*=""*/) { super((Pointer)null); allocate(model_so_path, num_models, device_str, cubin_dir); }
+ private native void allocate(
+ @StdString String model_so_path,
+ @Cast("size_t") long num_models/*=1*/,
+ @StdString String device_str/*="cuda"*/,
+ @StdString String cubin_dir/*=""*/);
+ public AOTIModelContainerRunnerCuda(
+ @StdString String model_so_path) { super((Pointer)null); allocate(model_so_path); }
+ private native void allocate(
+ @StdString String model_so_path);
+
+ public native @ByVal TensorVector run(@ByRef TensorVector inputs);
+
+ public native @ByVal TensorVector run_with_cuda_stream(
+ @ByRef TensorVector inputs,
+ @ByVal CUDAStream cuda_stream);
+}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/AllocatorConfigInfo.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/AllocatorConfigInfo.java
new file mode 100644
index 00000000000..e1cd6e5c4c7
--- /dev/null
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/AllocatorConfigInfo.java
@@ -0,0 +1,51 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.pytorch.cuda;
+
+import org.bytedeco.pytorch.*;
+import org.bytedeco.pytorch.cuda.functions.*;
+import org.bytedeco.pytorch.Error;
+import org.bytedeco.pytorch.global.torch.DeviceType;
+import org.bytedeco.pytorch.global.torch.ScalarType;
+import org.bytedeco.pytorch.global.torch.MemoryFormat;
+import org.bytedeco.pytorch.Allocator;
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+import static org.bytedeco.openblas.global.openblas_nolapack.*;
+import static org.bytedeco.openblas.global.openblas.*;
+import org.bytedeco.pytorch.*;
+import static org.bytedeco.pytorch.global.torch.*;
+
+import static org.bytedeco.pytorch.global.torch_cuda.*;
+
+
+@Namespace("c10::cuda::CUDACachingAllocator") @Properties(inherit = org.bytedeco.pytorch.presets.torch_cuda.class)
+public class AllocatorConfigInfo extends Pointer {
+ static { Loader.load(); }
+ /** Default native constructor. */
+ public AllocatorConfigInfo() { super((Pointer)null); allocate(); }
+ /** Native array allocator. Access with {@link Pointer#position(long)}. */
+ public AllocatorConfigInfo(long size) { super((Pointer)null); allocateArray(size); }
+ /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+ public AllocatorConfigInfo(Pointer p) { super(p); }
+ private native void allocate();
+ private native void allocateArray(long size);
+ @Override public AllocatorConfigInfo position(long position) {
+ return (AllocatorConfigInfo)super.position(position);
+ }
+ @Override public AllocatorConfigInfo getPointer(long i) {
+ return new AllocatorConfigInfo((Pointer)this).offsetAddress(i);
+ }
+
+ public native double garbage_collection_threshold(); public native AllocatorConfigInfo garbage_collection_threshold(double setter);
+ public native @Cast("size_t") long max_split_size(); public native AllocatorConfigInfo max_split_size(long setter);
+ public native @Cast("size_t") long pinned_num_register_threads(); public native AllocatorConfigInfo pinned_num_register_threads(long setter);
+ public native @Cast("bool") boolean expandable_segments(); public native AllocatorConfigInfo expandable_segments(boolean setter);
+ public native @Cast("bool") boolean release_lock_on_malloc(); public native AllocatorConfigInfo release_lock_on_malloc(boolean setter);
+ public native @Cast("bool") boolean pinned_use_host_register(); public native AllocatorConfigInfo pinned_use_host_register(boolean setter);
+ public native @StdString BytePointer last_allocator_settings(); public native AllocatorConfigInfo last_allocator_settings(BytePointer setter);
+ public native @ByRef @Cast("std::vector*") SizeTVector roundup_power2_divisions(); public native AllocatorConfigInfo roundup_power2_divisions(SizeTVector setter);
+}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/CTCLossDescriptor.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/CTCLossDescriptor.java
index 587ebac4a1a..2d72e4c6270 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/CTCLossDescriptor.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/CTCLossDescriptor.java
@@ -41,10 +41,8 @@ public class CTCLossDescriptor extends Pointer {
}
public native void set(@Cast("cudnnDataType_t") int datatype);
-// #if CUDNN_VERSION >= 7600
public native void setEx(
@Cast("cudnnDataType_t") int datatype,
@Cast("cudnnLossNormalizationMode_t") int normMode,
@Cast("cudnnNanPropagation_t") int gradMode);
-// #endif
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/CUDAAllocator.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/CUDAAllocator.java
index 8ead036744f..845775aa5dc 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/CUDAAllocator.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/CUDAAllocator.java
@@ -33,24 +33,26 @@ public class CUDAAllocator extends Allocator {
public native void raw_delete(Pointer ptr);
public native void init(int device_count);
public native @Cast("bool") boolean initialized();
- public native void setMemoryFraction(double fraction, int device);
+ public native void setMemoryFraction(double fraction, byte device);
public native void emptyCache();
- public native void cacheInfo(int dev_id, @Cast("size_t*") SizeTPointer largestBlock);
+ public native void cacheInfo(byte device, @Cast("size_t*") SizeTPointer largestBlock);
public native Pointer getBaseAllocation(Pointer ptr, @Cast("size_t*") SizeTPointer size);
- public native void recordStream(@Cast({"", "c10::DataPtr&&"}) @StdMove DataPtr arg0, @ByVal CUDAStream stream);
- public native @ByVal DeviceStats getDeviceStats(int device);
- public native void resetAccumulatedStats(int device);
- public native void resetPeakStats(int device);
+ public native void recordStream(@StdMove DataPtr arg0, @ByVal CUDAStream stream);
+ public native @ByVal DeviceStats getDeviceStats(byte device);
+ public native void resetAccumulatedStats(byte device);
+ public native void resetPeakStats(byte device);
public native @ByVal SnapshotInfo snapshot();
- public native void beginAllocateStreamToPool(
- int device,
- @Cast("cudaStream_t") Pointer stream,
+ public native void beginAllocateToPool(
+ byte device,
+ @ByVal @Cast("c10::cuda::MempoolId_t*") DeviceAssertionsDataVectorCUDAKernelLaunchInfoVectorPair mempool_id,
+ @ByVal StreamFilter filter);
+ public native void endAllocateToPool(
+ byte device,
@ByVal @Cast("c10::cuda::MempoolId_t*") DeviceAssertionsDataVectorCUDAKernelLaunchInfoVectorPair mempool_id);
- public native void endAllocateStreamToPool(int device, @Cast("cudaStream_t") Pointer stream);
- public native void releasePool(int device, @ByVal @Cast("c10::cuda::MempoolId_t*") DeviceAssertionsDataVectorCUDAKernelLaunchInfoVectorPair mempool_id);
+ public native void releasePool(byte device, @ByVal @Cast("c10::cuda::MempoolId_t*") DeviceAssertionsDataVectorCUDAKernelLaunchInfoVectorPair mempool_id);
// returns true if the allocated blocks are equal to expected live allocations
public native @Cast("bool") boolean checkPoolLiveAllocations(
- int device,
+ byte device,
@ByVal @Cast("c10::cuda::MempoolId_t*") DeviceAssertionsDataVectorCUDAKernelLaunchInfoVectorPair mempool_id,
@Const @ByRef PointerSet expected_live_allocations);
public native @SharedPtr Pointer getIpcDevPtr(@StdString BytePointer handle);
@@ -76,7 +78,9 @@ public native void recordHistory(
// callback.
public native void attachAllocatorTraceTracker(@ByVal AllocatorTraceTracker tracker);
- public native void enablePeerAccess(int dev, int dev_to_access);
+ public native void enablePeerAccess(
+ byte dev,
+ byte dev_to_access);
// memory not allocated from cudaMalloc cannot be copied
// across devices using cudaMemcpyAsync if peer to peer access is disabled.
@@ -98,10 +102,10 @@ public native void recordHistory(
@Cast("cudaStream_t") Pointer stream,
@Cast("bool") boolean p2p_enabled);
public native @SharedPtr("c10::cuda::CUDACachingAllocator::AllocatorState") @ByVal AllocatorState getCheckpointState(
- int device,
+ byte device,
@ByVal @Cast("c10::cuda::MempoolId_t*") DeviceAssertionsDataVectorCUDAKernelLaunchInfoVectorPair id);
public native @ByVal CheckpointDelta setCheckpointPoolState(
- int device,
+ byte device,
@SharedPtr("c10::cuda::CUDACachingAllocator::AllocatorState") @ByVal AllocatorState pps);
public native @StdString BytePointer name();
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceAssertionData.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceAssertionData.java
index cc8973cf24f..13d813e1177 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceAssertionData.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceAssertionData.java
@@ -43,12 +43,15 @@ public class DeviceAssertionData extends Pointer {
}
/** Stringification of the assertion */
+ // NOLINTNEXTLINE(*-c-arrays)
public native @Cast("char") byte assertion_msg(int i); public native DeviceAssertionData assertion_msg(int i, byte setter);
@MemberGetter public native @Cast("char*") BytePointer assertion_msg();
/** File the assertion was in */
+ // NOLINTNEXTLINE(*-c-arrays)
public native @Cast("char") byte filename(int i); public native DeviceAssertionData filename(int i, byte setter);
@MemberGetter public native @Cast("char*") BytePointer filename();
/** Name of the function the assertion was in */
+ // NOLINTNEXTLINE(*-c-arrays)
public native @Cast("char") byte function_name(int i); public native DeviceAssertionData function_name(int i, byte setter);
@MemberGetter public native @Cast("char*") BytePointer function_name();
/** Line number the assertion was at */
@@ -56,9 +59,11 @@ public class DeviceAssertionData extends Pointer {
/** Number uniquely identifying the kernel launch that triggered the assertion */
public native @Cast("uint32_t") int caller(); public native DeviceAssertionData caller(int setter);
/** block_id of the thread that failed the assertion */
+ // NOLINTNEXTLINE(*-c-arrays)
public native int block_id(int i); public native DeviceAssertionData block_id(int i, int setter);
@MemberGetter public native IntPointer block_id();
/** third_id of the thread that failed the assertion */
+ // NOLINTNEXTLINE(*-c-arrays)
public native int thread_id(int i); public native DeviceAssertionData thread_id(int i, int setter);
@MemberGetter public native IntPointer thread_id();
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceAssertionsData.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceAssertionsData.java
index c6a38b4110a..c7a9ee2b638 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceAssertionsData.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceAssertionsData.java
@@ -46,6 +46,7 @@ public class DeviceAssertionsData extends Pointer {
* in {@code assertions} */
public native int assertion_count(); public native DeviceAssertionsData assertion_count(int setter);
/** An array of assertions that will be written to in a race-free manner */
+ // NOLINTNEXTLINE(*-c-arrays)
public native @ByRef DeviceAssertionData assertions(int i); public native DeviceAssertionsData assertions(int i, DeviceAssertionData setter);
@MemberGetter public native DeviceAssertionData assertions();
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceStats.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceStats.java
index 1122dcfeef0..ab61f5fa58c 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceStats.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/DeviceStats.java
@@ -75,6 +75,17 @@ public class DeviceStats extends Pointer {
// COUNT: total number of oversize blocks requiring malloc
public native @ByRef Stat oversize_segments(); public native DeviceStats oversize_segments(Stat setter);
+ // COUNT: total number of synchronize_and_free_events() calls
+ public native @Cast("int64_t") long num_sync_all_streams(); public native DeviceStats num_sync_all_streams(long setter);
+
+ // COUNT: total number of CUDA allocation calls. This includes both cuMemMap
+ // and cudaMalloc.
+ public native @Cast("int64_t") long num_device_alloc(); public native DeviceStats num_device_alloc(long setter);
+
+ // COUNT: total number of CUDA free calls. This includes both cuMemUnmap
+ // and cudaFree.
+ public native @Cast("int64_t") long num_device_free(); public native DeviceStats num_device_free(long setter);
+
// SIZE: maximum block size that is allowed to be split.
public native @Cast("int64_t") long max_split_size(); public native DeviceStats max_split_size(long setter);
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/RNNDataDescriptor.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/RNNDataDescriptor.java
new file mode 100644
index 00000000000..a42bc32c9e9
--- /dev/null
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/RNNDataDescriptor.java
@@ -0,0 +1,56 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.pytorch.cuda;
+
+import org.bytedeco.pytorch.*;
+import org.bytedeco.pytorch.cuda.functions.*;
+import org.bytedeco.pytorch.Error;
+import org.bytedeco.pytorch.global.torch.DeviceType;
+import org.bytedeco.pytorch.global.torch.ScalarType;
+import org.bytedeco.pytorch.global.torch.MemoryFormat;
+import org.bytedeco.pytorch.Allocator;
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+import static org.bytedeco.openblas.global.openblas_nolapack.*;
+import static org.bytedeco.openblas.global.openblas.*;
+import org.bytedeco.pytorch.*;
+import static org.bytedeco.pytorch.global.torch.*;
+
+import static org.bytedeco.pytorch.global.torch_cuda.*;
+
+
+// A generic class for wrapping cuDNN descriptor types. All you need
+// is to give the underlying type the Descriptor_t points to (usually,
+// if it's cudnnTensorDescriptor_t it points to cudnnTensorStruct),
+// the constructor and the destructor. Subclasses are responsible
+// for defining a set() function to actually set the descriptor.
+//
+// Descriptors default construct to a nullptr, and have a descriptor
+// initialized the first time you call set() or any other initializing
+// function.
+
+@Namespace("at::native") @Properties(inherit = org.bytedeco.pytorch.presets.torch_cuda.class)
+public class RNNDataDescriptor extends Pointer {
+ static { Loader.load(); }
+ /** Default native constructor. */
+ public RNNDataDescriptor() { super((Pointer)null); allocate(); }
+ /** Native array allocator. Access with {@link Pointer#position(long)}. */
+ public RNNDataDescriptor(long size) { super((Pointer)null); allocateArray(size); }
+ /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+ public RNNDataDescriptor(Pointer p) { super(p); }
+ private native void allocate();
+ private native void allocateArray(long size);
+ @Override public RNNDataDescriptor position(long position) {
+ return (RNNDataDescriptor)super.position(position);
+ }
+ @Override public RNNDataDescriptor getPointer(long i) {
+ return new RNNDataDescriptor((Pointer)this).offsetAddress(i);
+ }
+
+ public native void set(@Const @ByRef Tensor t, @Cast("cudnnRNNDataLayout_t") int layout, int maxSeqLength, int batchSize, int vectorSize, @Const IntPointer seqLengthArray);
+ public native void set(@Const @ByRef Tensor t, @Cast("cudnnRNNDataLayout_t") int layout, int maxSeqLength, int batchSize, int vectorSize, @Const IntBuffer seqLengthArray);
+ public native void set(@Const @ByRef Tensor t, @Cast("cudnnRNNDataLayout_t") int layout, int maxSeqLength, int batchSize, int vectorSize, @Const int[] seqLengthArray);
+}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/RNNDescriptor.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/RNNDescriptor.java
index 831e24dc315..74596dae641 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/RNNDescriptor.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/RNNDescriptor.java
@@ -41,7 +41,10 @@ public class RNNDescriptor extends Pointer {
}
- public native void set(@Cast("cudnnHandle_t") Pointer handle, int hidden_size, int proj_size, int num_layers, @ByRef(true) DropoutDescriptor dropout_desc,
+ public native void set(@Cast("cudnnHandle_t") Pointer handle,
+ int input_size,
+ @Cast("bool") boolean packed,
+ int hidden_size, int proj_size, int num_layers, @ByRef(true) DropoutDescriptor dropout_desc,
@Cast("cudnnRNNInputMode_t") int input_mode, @Cast("cudnnDirectionMode_t") int bidirectional,
@Cast("cudnnRNNMode_t") int mode, @Cast("cudnnDataType_t") int datatype, @Cast("cudnnDataType_t") int input_type, @Cast("cudnnRNNAlgo_t") int algo, @Cast("bool") boolean allow_tf32);
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/SegmentInfo.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/SegmentInfo.java
index b22f2ccbc03..deac68b1f95 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/SegmentInfo.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/SegmentInfo.java
@@ -41,7 +41,7 @@ public class SegmentInfo extends Pointer {
return new SegmentInfo((Pointer)this).offsetAddress(i);
}
- public native @Cast("int64_t") long device(); public native SegmentInfo device(long setter);
+ public native byte device(); public native SegmentInfo device(byte setter);
public native @Cast("int64_t") @Name("address") long _address(); public native SegmentInfo _address(long setter);
public native @Cast("int64_t") long total_size(); public native SegmentInfo total_size(long setter);
public native @Cast("int64_t") long requested_size(); public native SegmentInfo requested_size(long setter); // unrounded, actually requested size
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/SnapshotInfo.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/SnapshotInfo.java
index 19af7311a7e..bdb993045d9 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/SnapshotInfo.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/SnapshotInfo.java
@@ -42,4 +42,5 @@ public class SnapshotInfo extends Pointer {
public native @StdVector SegmentInfo segments(); public native SnapshotInfo segments(SegmentInfo setter);
public native @StdVector TraceEntryVector device_traces(); public native SnapshotInfo device_traces(TraceEntryVector setter);
+ public native @ByRef AllocatorConfigInfo config_metadata(); public native SnapshotInfo config_metadata(AllocatorConfigInfo setter);
}
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/TensorDescriptor.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/TensorDescriptor.java
index a602c344567..c1b7a56ab77 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/TensorDescriptor.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/TensorDescriptor.java
@@ -22,16 +22,6 @@
import static org.bytedeco.pytorch.global.torch_cuda.*;
-// A generic class for wrapping cuDNN descriptor types. All you need
-// is to give the underlying type the Descriptor_t points to (usually,
-// if it's cudnnTensorDescriptor_t it points to cudnnTensorStruct),
-// the constructor and the destructor. Subclasses are responsible
-// for defining a set() function to actually set the descriptor.
-//
-// Descriptors default construct to a nullptr, and have a descriptor
-// initialized the first time you call set() or any other initializing
-// function.
-
@Namespace("at::native") @Properties(inherit = org.bytedeco.pytorch.presets.torch_cuda.class)
public class TensorDescriptor extends Pointer {
static { Loader.load(); }
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/TraceEntry.java b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/TraceEntry.java
index 4077a77c580..c1c219d3134 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/TraceEntry.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/cuda/TraceEntry.java
@@ -52,7 +52,7 @@ public enum Action {
}
public TraceEntry(
Action action,
- int device,
+ byte device,
@Cast("int64_t") long addr,
@Cast("size_t") long size,
@Cast("cudaStream_t") Pointer stream,
@@ -60,7 +60,7 @@ public TraceEntry(
@SharedPtr GatheredContext context/*=nullptr*/) { super((Pointer)null); allocate(action, device, addr, size, stream, time, context); }
private native void allocate(
Action action,
- int device,
+ byte device,
@Cast("int64_t") long addr,
@Cast("size_t") long size,
@Cast("cudaStream_t") Pointer stream,
@@ -68,21 +68,21 @@ private native void allocate(
@SharedPtr GatheredContext context/*=nullptr*/);
public TraceEntry(
Action action,
- int device,
+ byte device,
@Cast("int64_t") long addr,
@Cast("size_t") long size,
@Cast("cudaStream_t") Pointer stream,
@Cast("c10::approx_time_t") long time) { super((Pointer)null); allocate(action, device, addr, size, stream, time); }
private native void allocate(
Action action,
- int device,
+ byte device,
@Cast("int64_t") long addr,
@Cast("size_t") long size,
@Cast("cudaStream_t") Pointer stream,
@Cast("c10::approx_time_t") long time);
public TraceEntry(
@Cast("c10::cuda::CUDACachingAllocator::TraceEntry::Action") int action,
- int device,
+ byte device,
@Cast("int64_t") long addr,
@Cast("size_t") long size,
@Cast("cudaStream_t") Pointer stream,
@@ -90,7 +90,7 @@ public TraceEntry(
@SharedPtr GatheredContext context/*=nullptr*/) { super((Pointer)null); allocate(action, device, addr, size, stream, time, context); }
private native void allocate(
@Cast("c10::cuda::CUDACachingAllocator::TraceEntry::Action") int action,
- int device,
+ byte device,
@Cast("int64_t") long addr,
@Cast("size_t") long size,
@Cast("cudaStream_t") Pointer stream,
@@ -98,20 +98,20 @@ private native void allocate(
@SharedPtr GatheredContext context/*=nullptr*/);
public TraceEntry(
@Cast("c10::cuda::CUDACachingAllocator::TraceEntry::Action") int action,
- int device,
+ byte device,
@Cast("int64_t") long addr,
@Cast("size_t") long size,
@Cast("cudaStream_t") Pointer stream,
@Cast("c10::approx_time_t") long time) { super((Pointer)null); allocate(action, device, addr, size, stream, time); }
private native void allocate(
@Cast("c10::cuda::CUDACachingAllocator::TraceEntry::Action") int action,
- int device,
+ byte device,
@Cast("int64_t") long addr,
@Cast("size_t") long size,
@Cast("cudaStream_t") Pointer stream,
@Cast("c10::approx_time_t") long time);
public native Action action_(); public native TraceEntry action_(Action setter);
- public native int device_(); public native TraceEntry device_(int setter);
+ public native byte device_(); public native TraceEntry device_(byte setter);
public native @Cast("int64_t") long addr_(); public native TraceEntry addr_(long setter); // for OOM, this is the amount of free bytes reported by cuda
public native @SharedPtr GatheredContext context_(); public native TraceEntry context_(GatheredContext setter);
public native @Cast("cudaStream_t") Pointer stream_(); public native TraceEntry stream_(Pointer setter);
diff --git a/pytorch/src/gen/java/org/bytedeco/pytorch/global/torch.java b/pytorch/src/gen/java/org/bytedeco/pytorch/global/torch.java
index a64491b5db0..cd5d30c8eff 100644
--- a/pytorch/src/gen/java/org/bytedeco/pytorch/global/torch.java
+++ b/pytorch/src/gen/java/org/bytedeco/pytorch/global/torch.java
@@ -77,6 +77,9 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// Targeting ../DeviceOptional.java
+// Targeting ../DeviceTypeOptional.java
+
+
// Targeting ../LongArrayRefOptional.java
@@ -527,6 +530,9 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// Targeting ../TreeRefStringMap.java
+// Targeting ../StringIntMap.java
+
+
// Targeting ../StringSet.java
@@ -759,6 +765,12 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #define TORCH_HIP_API C10_IMPORT
// #endif
+// #if defined(TORCH_XPU_BUILD_MAIN_LIB)
+// #define TORCH_XPU_API C10_EXPORT
+// #else
+// #define TORCH_XPU_API C10_IMPORT
+// #endif
+
// Enums only need to be exported on windows for non-CUDA files
// #if defined(_WIN32) && defined(__CUDACC__)
// #define C10_API_ENUM C10_API
@@ -934,11 +946,10 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// Simply define the namespace, in case a dependent library want to refer to
// the c10 namespace but not any nontrivial files.
- // namespace c10
- // namespace c10
- // namespace c10
+
+
// Since C10 is the core library for caffe2 (and aten), we will simply reroute
// all abstractions defined in c10 to be available in caffe2 as well.
@@ -946,8 +957,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// c10 namespace where possible.
-
- // namespace at
+ // namespace at::cuda
// WARNING!!! THIS IS A GIANT HACK!!!
// This line means you cannot simultaneously include c10/hip
@@ -957,8 +967,8 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// from at::cuda. This namespace makes that happen. When
// HIPIFY is no longer out-of-place, we can switch the cuda
// here to hip and everyone is happy.
-
- // namespace at
+ // namespace at::cuda
+ // namespace at::xpu
// C10_LIKELY/C10_UNLIKELY
//
@@ -1006,13 +1016,6 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #define C10_ERASE C10_ALWAYS_INLINE C10_ATTR_VISIBILITY_HIDDEN
-// C10_FALLTHROUGH - Annotate fallthrough to the next case in a switch.
-// #if C10_HAS_CPP_ATTRIBUTE(fallthrough)
-// #define C10_FALLTHROUGH [[fallthrough]]
-// #else
-// #define C10_FALLTHROUGH
-// #endif
-
// #include
// #ifdef __HIPCC__
@@ -1090,16 +1093,6 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #define C10_ALWAYS_INLINE_UNLESS_MOBILE C10_ALWAYS_INLINE
// #endif
-// Portable determination of whether type T is trivially copyable.
-// Warning: __has_trivial_copy for GCC may not always detect the non-POD
-// correctly. For example, T = std::unique_ptr may evaluate to true and be
-// treated as POD. This can cause unexpected behavior.
-// #if defined(__GNUG__) && __GNUC__ < 5 && !defined(__clang__)
-// #define C10_IS_TRIVIALLY_COPYABLE(T) __has_trivial_copy(T)
-// #else
-// #define C10_IS_TRIVIALLY_COPYABLE(T) std::is_trivially_copyable::value
-// #endif
-
// #if defined(__CUDA_ARCH__)
// #if defined(_MSC_VER) && defined(__CUDACC__)
// #define CONSTEXPR_EXCEPT_WIN_CUDA const
@@ -1225,8 +1218,11 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
+// #include
+// #include
// #include
// #include
+// #include
// These contains all device types that also have a BackendComponent
// and therefore participate in per-backend functionality dispatch keys.
@@ -1318,9 +1314,12 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
@Namespace("c10") public static native @StdString BytePointer get_privateuse1_backend(@Cast("bool") boolean lower_case/*=true*/);
@Namespace("c10") public static native @StdString BytePointer get_privateuse1_backend();
+@Namespace("c10") public static native @Cast("bool") boolean is_privateuse1_backend_registered();
+
// namespace c10
// namespace std
-
+// NOLINTNEXTLINE(misc-unused-using-decls)
+ // namespace torch
// Parsed from c10/util/Deprecated.h
@@ -1414,7 +1413,6 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
// #include
-// #include
// #if C10_CLANG_HAS_WARNING("-Wshorten-64-to-32")
// #endif
@@ -1433,6 +1431,11 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
+// Overloads of _str for wide types; forces narrowing.
+
+
+
+
@@ -1473,10 +1476,11 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #ifndef C10_UTIL_EXCEPTION_H_
// #define C10_UTIL_EXCEPTION_H_
+// #include
// #include
// #include
-// #include
+// #include
// #include
// #include
// #include
@@ -1722,8 +1726,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
@Namespace("c10::detail") public static native String torchCheckMsgImpl(
String arg0,
String args);
- // namespace detail
- // namespace c10
+ // namespace c10::detail
// #define TORCH_CHECK_MSG(cond, type, ...)
// (::c10::detail::torchCheckMsgImpl(
@@ -1779,8 +1782,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
String condMsg,
@ByVal CompileTimeEmptyString arg4);
- // namespace detail
- // namespace c10
+ // namespace c10::detail
// #ifdef STRIP_ERROR_MESSAGES
// #define TORCH_CHECK(cond, ...)
@@ -1934,8 +1936,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
*/
- // namespace detail
- // namespace c10
+ // namespace c10::detail
// Deprecated alias; this alias was deprecated because people kept mistakenly
// using it for user error checking. Use TORCH_INTERNAL_ASSERT or TORCH_CHECK
@@ -1983,6 +1984,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
+// #include
// #include
// #include
// #include
@@ -2007,7 +2009,9 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
+// #include
// #include
+// #include
// #include
// #include
@@ -2058,6 +2062,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// _(Dense, )
// _(Quantized, Quantized)
// _(Sparse, Sparse)
+// _(SparseCsr, SparseCsr)
// _(NestedTensor, NestedTensor)
// _(AutogradFunctionality, Autograd)
@@ -2236,36 +2241,34 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// See [Note: Per-Backend Functionality Dispatch Keys]
Sparse((short)(Undefined.value + 9)),
- // TODO: Make SparseCsr a functionality key
- SparseCsrCPU((short)(Undefined.value + 10)),
- SparseCsrCUDA((short)(Undefined.value + 11)),
+ SparseCsr((short)(Undefined.value + 10)),
- NestedTensor((short)(Undefined.value + 12)),
+ NestedTensor((short)(Undefined.value + 11)),
// In some situations, it is not immediately obvious what the correct
// backend for function is, because the function in question doesn't
// have any "tensor" arguments. In this case, a BackendSelect function
// can be registered to implement the custom determination of the
// correct backend.
- BackendSelect((short)(Undefined.value + 13)),
+ BackendSelect((short)(Undefined.value + 12)),
- Python((short)(Undefined.value + 14)),
+ Python((short)(Undefined.value + 13)),
// Out-of-core key for Fake Tensor in torchdistx.
// See https://pytorch.org/torchdistx/latest/fake_tensor.html
// TODO: delete this in favor of Python-implemented fake tensor
- Fake((short)(Undefined.value + 15)),
+ Fake((short)(Undefined.value + 14)),
// See Note [Out-of-tree vmap+grad prototype]. The purpose of this key
// is to insert code after the "autograd subsystem" runs, so this key should
// be directly after ADInplaceOrView and all of the autograd keys.
- FuncTorchDynamicLayerBackMode((short)(Undefined.value + 16)),
+ FuncTorchDynamicLayerBackMode((short)(Undefined.value + 15)),
// Alias and mutation removal.
// If some backends want to opt into only alias removal or only mutation
// removal,
// we can consider adding separate keys dedicated to those individual passes.
// See Note [Functionalization Pass In Core] for details.
- Functionalize((short)(Undefined.value + 17)),
+ Functionalize((short)(Undefined.value + 16)),
// The named dispatch key is set for any tensors with named dimensions.
// Although we have a dispatch key for named tensors, for historical reasons,
@@ -2280,19 +2283,19 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// has named dimension propagation that doesn't match that of its
// constituent parts.
// TODO: delete this once torchdim lands in functorch
- Named((short)(Undefined.value + 18)),
+ Named((short)(Undefined.value + 17)),
// The Conjugate dispatch key is set for any tensors that need to perform
// conjugation
// This is implemented at a dispatch level right before any backends run
- Conjugate((short)(Undefined.value + 19)),
+ Conjugate((short)(Undefined.value + 18)),
// The Negative dispatch key is set for any tensors that need to perform
// negation
// This is implemented at a dispatch level right before any backends run
- Negative((short)(Undefined.value + 20)),
+ Negative((short)(Undefined.value + 19)),
- ZeroTensor((short)(Undefined.value + 21)), // registered at build/aten/src/ATen/RegisterZeroTensor.cpp
+ ZeroTensor((short)(Undefined.value + 20)), // registered at build/aten/src/ATen/RegisterZeroTensor.cpp
// Note [ADInplaceOrView key]
// ADInplaceOrView key is used by inplace or view ops to register a kernel
@@ -2329,7 +2332,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// `at::AutoDispatchBelowADInplaceOrView` guard of functional ops
// up to the `VariableType` kernel. Thus we only add the extra dispatch
// to view/inplace ops to minimize its perf impact to real models.
- ADInplaceOrView((short)(Undefined.value + 22)),
+ ADInplaceOrView((short)(Undefined.value + 21)),
// Note [Alias Dispatch Key : Autograd]
// All backends are oblivious to autograd; autograd is handled as a
// layer which happens on top of all backends. It inspects the autograd
@@ -2355,10 +2358,10 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// reserved user-defined backends. All other in-tree backends share the
// AutogradOther key. We can add specific autograd key for those backends
// upon request.
- AutogradOther((short)(Undefined.value + 23)),
+ AutogradOther((short)(Undefined.value + 22)),
// See [Note: Per-Backend Functionality Dispatch Keys]
- AutogradFunctionality((short)(Undefined.value + 24)),
+ AutogradFunctionality((short)(Undefined.value + 23)),
// NestedTensor is an example of something that isn't a "real backend"
// (because it mostly consists of redispatching kernels)
@@ -2367,64 +2370,64 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// exclusively for handling autograd for NestedTensor.
// lives out of tree at
// https://github.com/pytorch/nestedtensor
- AutogradNestedTensor((short)(Undefined.value + 25)),
+ AutogradNestedTensor((short)(Undefined.value + 24)),
- Tracer((short)(Undefined.value + 26)),
+ Tracer((short)(Undefined.value + 25)),
// TODO: make Autocast a functionality key
// Autocasting precedes VariableTypeId, to ensure casts are autograd-exposed
// and inputs are saved for backward in the post-autocast type.
- AutocastCPU((short)(Undefined.value + 27)),
- AutocastXPU((short)(Undefined.value + 28)),
- AutocastIPU((short)(Undefined.value + 29)),
- AutocastHPU((short)(Undefined.value + 30)),
- AutocastXLA((short)(Undefined.value + 31)),
+ AutocastCPU((short)(Undefined.value + 26)),
+ AutocastXPU((short)(Undefined.value + 27)),
+ AutocastIPU((short)(Undefined.value + 28)),
+ AutocastHPU((short)(Undefined.value + 29)),
+ AutocastXLA((short)(Undefined.value + 30)),
// AutocastXLA is only being used for TPUs. XLA GPUs continue to use
// AutocastCUDA.
- AutocastCUDA((short)(Undefined.value + 32)),
- AutocastPrivateUse1((short)(Undefined.value + 33)),
+ AutocastCUDA((short)(Undefined.value + 31)),
+ AutocastPrivateUse1((short)(Undefined.value + 32)),
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ WRAPPERS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
// There are a number of alternative modes which may want to handle before
// autograd; for example, error checking, tracing, profiling or vmap. They
// go here.
- FuncTorchBatched((short)(Undefined.value + 34)), // See Note [Out-of-tree vmap+grad prototype]
+ FuncTorchBatched((short)(Undefined.value + 33)), // See Note [Out-of-tree vmap+grad prototype]
// Dispatch key for BatchedTensorImpl wrapping a nested tensor.
- BatchedNestedTensor((short)(Undefined.value + 35)),
+ BatchedNestedTensor((short)(Undefined.value + 34)),
- FuncTorchVmapMode((short)(Undefined.value + 36)), // See Note [Out-of-tree vmap+grad prototype]
+ FuncTorchVmapMode((short)(Undefined.value + 35)), // See Note [Out-of-tree vmap+grad prototype]
// This is the dispatch key for BatchedTensorImpl, which is used to implement
// batching rules for vmap.
- Batched((short)(Undefined.value + 37)),
+ Batched((short)(Undefined.value + 36)),
// When we are inside a vmap, all tensors dispatch on this key.
// See Note: [DispatchKey::VmapMode usage] for more details.
- VmapMode((short)(Undefined.value + 38)),
+ VmapMode((short)(Undefined.value + 37)),
- FuncTorchGradWrapper((short)(Undefined.value + 39)), // See Note [Out-of-tree vmap+grad prototype]
+ FuncTorchGradWrapper((short)(Undefined.value + 38)), // See Note [Out-of-tree vmap+grad prototype]
// Out-of-core key for Deferred Module Initialization in torchdistx.
// See https://pytorch.org/torchdistx/latest/deferred_init.html
- DeferredInit((short)(Undefined.value + 40)),
+ DeferredInit((short)(Undefined.value + 39)),
// Used by Python key logic to know the set of tls on entry to the dispatcher
// This kernel assumes it is the top-most non-functorch-related DispatchKey.
// If you add a key above, make sure to update the fallback implementation for
// this.
- PythonTLSSnapshot((short)(Undefined.value + 41)),
+ PythonTLSSnapshot((short)(Undefined.value + 40)),
// This key should be at the very top of the dispatcher
- FuncTorchDynamicLayerFrontMode((short)(Undefined.value + 42)), // See Note [Out-of-tree vmap+grad prototype]
+ FuncTorchDynamicLayerFrontMode((short)(Undefined.value + 41)), // See Note [Out-of-tree vmap+grad prototype]
// TESTING: This is intended to be a generic testing tensor type id.
// Don't use it for anything real; its only acceptable use is within a single
// process test. Use it by creating a TensorImpl with this DispatchKey, and
// then registering operators to operate on this type id. See
// aten/src/ATen/core/dispatch/backend_fallback_test.cpp for a usage example.
- TESTING_ONLY_GenericWrapper((short)(Undefined.value + 43)),
+ TESTING_ONLY_GenericWrapper((short)(Undefined.value + 42)),
// TESTING: This is intended to be a generic testing tensor type id.
// Don't use it for anything real; its only acceptable use is within a ingle
@@ -2433,51 +2436,51 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// to operate on this type id. See
// aten/src/ATen/core/dispatch/backend_fallback_test.cpp
// for a usage example
- TESTING_ONLY_GenericMode((short)(Undefined.value + 44)),
+ TESTING_ONLY_GenericMode((short)(Undefined.value + 43)),
// This key is used for pre-dispatch tracing in make_fx.
// It has lower priority than the PythonDispatcher key
// because we use the PythonDispatcher to intercept the key from python,
// and avoid having to implement it in C++.
- PreDispatch((short)(Undefined.value + 45)),
+ PreDispatch((short)(Undefined.value + 44)),
// This is a bypass that allows you to skip running the C++ dispatcher
// entirely
- PythonDispatcher((short)(Undefined.value + 46)),
+ PythonDispatcher((short)(Undefined.value + 45)),
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FIN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
- EndOfFunctionalityKeys((short)(Undefined.value + 47)),
+ EndOfFunctionalityKeys((short)(Undefined.value + 46)),
- StartOfDenseBackends((short)(Undefined.value + 48)),
- CPU((short)(Undefined.value + 49)),
+ StartOfDenseBackends((short)(Undefined.value + 47)),
+ CPU((short)(Undefined.value + 48)),
- CUDA((short)(Undefined.value + 50)),
+ CUDA((short)(Undefined.value + 49)),
- HIP((short)(Undefined.value + 51)),
+ HIP((short)(Undefined.value + 50)),
- XLA((short)(Undefined.value + 52)),
+ XLA((short)(Undefined.value + 51)),
- MPS((short)(Undefined.value + 53)),
+ MPS((short)(Undefined.value + 52)),
- IPU((short)(Undefined.value + 54)),
+ IPU((short)(Undefined.value + 53)),
- XPU((short)(Undefined.value + 55)),
+ XPU((short)(Undefined.value + 54)),
- HPU((short)(Undefined.value + 56)),
+ HPU((short)(Undefined.value + 55)),
- VE((short)(Undefined.value + 57)),
+ VE((short)(Undefined.value + 56)),
- Lazy((short)(Undefined.value + 58)),
+ Lazy((short)(Undefined.value + 57)),
- MTIA((short)(Undefined.value + 59)),
+ MTIA((short)(Undefined.value + 58)),
- PrivateUse1((short)(Undefined.value + 60)),
+ PrivateUse1((short)(Undefined.value + 59)),
- PrivateUse2((short)(Undefined.value + 61)),
+ PrivateUse2((short)(Undefined.value + 60)),
- PrivateUse3((short)(Undefined.value + 62)),
+ PrivateUse3((short)(Undefined.value + 61)),
- Meta((short)(Undefined.value + 63)),
+ Meta((short)(Undefined.value + 62)),
EndOfDenseBackends((short)(0)),
StartOfQuantizedBackends((short)(1)),
QuantizedCPU((short)(2)),
@@ -2541,36 +2544,67 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
SparseMeta((short)( QuantizedMeta.value + 16)),
EndOfSparseBackends((short)( SparseMeta.value)),
- StartOfNestedTensorBackends((short)( SparseMeta.value + 1)),
- NestedTensorCPU((short)( SparseMeta.value + 2)),
+ StartOfSparseCsrBackends((short)( SparseMeta.value + 1)),
+ SparseCsrCPU((short)( SparseMeta.value + 2)),
+
+ SparseCsrCUDA((short)( SparseMeta.value + 3)),
+
+ SparseCsrHIP((short)( SparseMeta.value + 4)),
- NestedTensorCUDA((short)( SparseMeta.value + 3)),
+ SparseCsrXLA((short)( SparseMeta.value + 5)),
- NestedTensorHIP((short)( SparseMeta.value + 4)),
+ SparseCsrMPS((short)( SparseMeta.value + 6)),
- NestedTensorXLA((short)( SparseMeta.value + 5)),
+ SparseCsrIPU((short)( SparseMeta.value + 7)),
- NestedTensorMPS((short)( SparseMeta.value + 6)),
+ SparseCsrXPU((short)( SparseMeta.value + 8)),
- NestedTensorIPU((short)( SparseMeta.value + 7)),
+ SparseCsrHPU((short)( SparseMeta.value + 9)),
- NestedTensorXPU((short)( SparseMeta.value + 8)),
+ SparseCsrVE((short)( SparseMeta.value + 10)),
- NestedTensorHPU((short)( SparseMeta.value + 9)),
+ SparseCsrLazy((short)( SparseMeta.value + 11)),
- NestedTensorVE((short)( SparseMeta.value + 10)),
+ SparseCsrMTIA((short)( SparseMeta.value + 12)),
- NestedTensorLazy((short)( SparseMeta.value + 11)),
+ SparseCsrPrivateUse1((short)( SparseMeta.value + 13)),
- NestedTensorMTIA((short)( SparseMeta.value + 12)),
+ SparseCsrPrivateUse2((short)( SparseMeta.value + 14)),
- NestedTensorPrivateUse1((short)( SparseMeta.value + 13)),
+ SparseCsrPrivateUse3((short)( SparseMeta.value + 15)),
- NestedTensorPrivateUse2((short)( SparseMeta.value + 14)),
+ SparseCsrMeta((short)( SparseMeta.value + 16)),
+ EndOfSparseCsrBackends((short)( SparseCsrMeta.value)),
+ StartOfNestedTensorBackends((short)( SparseCsrMeta.value + 1)),
+ NestedTensorCPU((short)( SparseCsrMeta.value + 2)),
- NestedTensorPrivateUse3((short)( SparseMeta.value + 15)),
+ NestedTensorCUDA((short)( SparseCsrMeta.value + 3)),
- NestedTensorMeta((short)( SparseMeta.value + 16)),
+ NestedTensorHIP((short)( SparseCsrMeta.value + 4)),
+
+ NestedTensorXLA((short)( SparseCsrMeta.value + 5)),
+
+ NestedTensorMPS((short)( SparseCsrMeta.value + 6)),
+
+ NestedTensorIPU((short)( SparseCsrMeta.value + 7)),
+
+ NestedTensorXPU((short)( SparseCsrMeta.value + 8)),
+
+ NestedTensorHPU((short)( SparseCsrMeta.value + 9)),
+
+ NestedTensorVE((short)( SparseCsrMeta.value + 10)),
+
+ NestedTensorLazy((short)( SparseCsrMeta.value + 11)),
+
+ NestedTensorMTIA((short)( SparseCsrMeta.value + 12)),
+
+ NestedTensorPrivateUse1((short)( SparseCsrMeta.value + 13)),
+
+ NestedTensorPrivateUse2((short)( SparseCsrMeta.value + 14)),
+
+ NestedTensorPrivateUse3((short)( SparseCsrMeta.value + 15)),
+
+ NestedTensorMeta((short)( SparseCsrMeta.value + 16)),
EndOfNestedTensorBackends((short)( NestedTensorMeta.value)),
StartOfAutogradFunctionalityBackends((short)( NestedTensorMeta.value + 1)),
AutogradCPU((short)( NestedTensorMeta.value + 2)),
@@ -2778,6 +2812,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// namespace c10
// Expose the constant, but not the TYPE (DispatchKey is an implementation
// detail!)
+// NOLINTNEXTLINE(misc-unused-using-decls)
// namespace torch
// NB: You really shouldn't use this instance; this enum is guaranteed
@@ -2789,7 +2824,8 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #pragma once
-// #include
+// #include
+// #include
/**
* is_equality_comparable is true_type iff the equality operator is defined
@@ -2850,17 +2886,19 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
* // true We define it here to resolve a MSVC bug. See
* https://github.com/pytorch/pytorch/issues/30932 for details.
*/
- // namespace guts
- // namespace c10
+ // namespace c10::guts
// Parsed from c10/util/TypeList.h
// #pragma once
-// #include
// #include
// #include
+// #include
+// #include
+// #include
+// #include
/**
* Type holding a list of types for compile time type computations
@@ -3022,8 +3060,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// namespace detail
// namespace typelist
- // namespace guts
- // namespace c10
+ // namespace c10::guts
// Parsed from c10/util/bit_cast.h
@@ -3047,11 +3084,20 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #pragma once
// #include
+// #include
+// #include
// #include
// #include
+// #include
// #include
// #include
+// #include
+// #include
+// #include
+// #include
// #include
+// #include
+// #include
// Targeting ../FunctionalityOffsetAndMask.java
@@ -3229,23 +3275,27 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
SparseVE(12),
SparseXPU(13),
SparsePrivateUse1(14),
- ORT(15),
- XLA(16),
- Vulkan(17),
- Metal(18),
- Meta(19),
- QuantizedCPU(20),
- QuantizedCUDA(21),
- QuantizedXPU(22),
- QuantizedPrivateUse1(23),
- Undefined(24),
- MkldnnCPU(25),
- MPS(26),
- HPU(27),
- Lazy(28),
- MTIA(29),
- PrivateUse1(30),
- NumOptions(31);
+ SparseCsrHIP(15),
+ SparseCsrVE(16),
+ SparseCsrXPU(17),
+ SparseCsrPrivateUse1(18),
+ ORT(19),
+ XLA(20),
+ Vulkan(21),
+ Metal(22),
+ Meta(23),
+ QuantizedCPU(24),
+ QuantizedCUDA(25),
+ QuantizedXPU(26),
+ QuantizedPrivateUse1(27),
+ Undefined(28),
+ MkldnnCPU(29),
+ MPS(30),
+ HPU(31),
+ Lazy(32),
+ MTIA(33),
+ PrivateUse1(34),
+ NumOptions(35);
public final int value;
private Backend(int v) { this.value = v; }
@@ -3283,6 +3333,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
+// #include
// #include
@Namespace("c10") public enum Layout {
Strided((byte)(0)),
@@ -3419,7 +3470,6 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
// #include
-// #include
// #include
// #include
// #include
@@ -3526,12 +3576,18 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #pragma once
+// #include
// #include
// #include
// #include
// #include
+// #include
+// #include
+// #include
// #include
+// #include
+// #include
// #include
// Targeting ../ArgumentArrayRef.java
@@ -3675,11 +3731,12 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #pragma once
-// #include
// #include
// #include
+// #include
// #include
+// #include
// Memory format is not the property of a Tensor. It is the way to tell an
// operator how the result should be organized in memory and nothing more. That
@@ -3815,8 +3872,9 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #pragma once
-// #include
// #include
+// #include
+// #include
/**
* QScheme is an enum that specifies the type of quantization. This has a one
@@ -3850,6 +3908,13 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #pragma once
// #include
+// #include
+// #include
+// #include
+// #include
+// #include
+// #include
+// #include
/** An index representing a specific stream. A StreamId is not independently
* meaningful without knowing the Device it is associated with; try to
@@ -3888,6 +3953,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
+// #include
// #include
// #if defined(__CUDACC__) && !defined(USE_ROCM)
@@ -4114,6 +4180,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #pragma once
+// #include
// #include
@Namespace("c10::detail") public static native float fp32_from_bits(@Cast("uint32_t") int w);
@@ -4267,7 +4334,6 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
* and inspired by Half implementation from pytorch/c10/util/Half.h */
// #include
-// #include
// #include
// #include
// #include
@@ -4323,11 +4389,29 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include // IWYU pragma: keep
+// Parsed from c10/util/Float8_fnuz_cvt.h
+
+// #pragma once
+
+// #include
+
+// #include
+
+/*
+ * Convert a 8-bit floating-point number in either f8 E4M3FNUZ or bf8 E5M2FNUZ
+ * format, in bit representation, to a 32-bit floating-point number.
+ */
+
+ // namespace c10::detail
+
+
// Parsed from c10/util/Float8_e4m3fnuz-inl.h
// #pragma once
// #include
+// #include
+// #include
// #include
// #if C10_CLANG_HAS_WARNING("-Wimplicit-int-float-conversion")
@@ -4345,6 +4429,100 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
+/** Arithmetic */
+
+@Namespace("c10") public static native @ByVal @Name("operator +") Float8_e4m3fnuz add(@Const @ByRef Float8_e4m3fnuz a, @Const @ByRef Float8_e4m3fnuz b);
+
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e4m3fnuz subtract(@Const @ByRef Float8_e4m3fnuz a, @Const @ByRef Float8_e4m3fnuz b);
+
+@Namespace("c10") public static native @ByVal @Name("operator *") Float8_e4m3fnuz multiply(@Const @ByRef Float8_e4m3fnuz a, @Const @ByRef Float8_e4m3fnuz b);
+
+@Namespace("c10") public static native @ByVal @Name("operator /") Float8_e4m3fnuz divide(
+ @Const @ByRef Float8_e4m3fnuz a,
+ @Const @ByRef Float8_e4m3fnuz b);
+
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e4m3fnuz subtract(@Const @ByRef Float8_e4m3fnuz a);
+
+@Namespace("c10") public static native @ByRef @Name("operator +=") Float8_e4m3fnuz addPut(
+ @ByRef Float8_e4m3fnuz a,
+ @Const @ByRef Float8_e4m3fnuz b);
+
+@Namespace("c10") public static native @ByRef @Name("operator -=") Float8_e4m3fnuz subtractPut(
+ @ByRef Float8_e4m3fnuz a,
+ @Const @ByRef Float8_e4m3fnuz b);
+
+@Namespace("c10") public static native @ByRef @Name("operator *=") Float8_e4m3fnuz multiplyPut(
+ @ByRef Float8_e4m3fnuz a,
+ @Const @ByRef Float8_e4m3fnuz b);
+
+@Namespace("c10") public static native @ByRef @Name("operator /=") Float8_e4m3fnuz dividePut(
+ @ByRef Float8_e4m3fnuz a,
+ @Const @ByRef Float8_e4m3fnuz b);
+
+/** Arithmetic with floats */
+
+@Namespace("c10") public static native @Name("operator +") float add(@ByVal Float8_e4m3fnuz a, float b);
+@Namespace("c10") public static native @Name("operator -") float subtract(@ByVal Float8_e4m3fnuz a, float b);
+@Namespace("c10") public static native @Name("operator *") float multiply(@ByVal Float8_e4m3fnuz a, float b);
+@Namespace("c10") public static native @Name("operator /") float divide(@ByVal Float8_e4m3fnuz a, float b);
+
+@Namespace("c10") public static native @Name("operator +") float add(float a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @Name("operator -") float subtract(float a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @Name("operator *") float multiply(float a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @Name("operator /") float divide(float a, @ByVal Float8_e4m3fnuz b);
+
+@Namespace("c10") public static native @ByRef @Name("operator +=") FloatPointer addPut(@ByRef FloatPointer a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator +=") FloatBuffer addPut(@ByRef FloatBuffer a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator +=") float[] addPut(@ByRef float[] a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator -=") FloatPointer subtractPut(@ByRef FloatPointer a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator -=") FloatBuffer subtractPut(@ByRef FloatBuffer a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator -=") float[] subtractPut(@ByRef float[] a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator *=") FloatPointer multiplyPut(@ByRef FloatPointer a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator *=") FloatBuffer multiplyPut(@ByRef FloatBuffer a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator *=") float[] multiplyPut(@ByRef float[] a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator /=") FloatPointer dividePut(@ByRef FloatPointer a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator /=") FloatBuffer dividePut(@ByRef FloatBuffer a, @Const @ByRef Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator /=") float[] dividePut(@ByRef float[] a, @Const @ByRef Float8_e4m3fnuz b);
+
+/** Arithmetic with doubles */
+
+@Namespace("c10") public static native @Name("operator +") double add(@ByVal Float8_e4m3fnuz a, double b);
+@Namespace("c10") public static native @Name("operator -") double subtract(@ByVal Float8_e4m3fnuz a, double b);
+@Namespace("c10") public static native @Name("operator *") double multiply(@ByVal Float8_e4m3fnuz a, double b);
+@Namespace("c10") public static native @Name("operator /") double divide(@ByVal Float8_e4m3fnuz a, double b);
+
+@Namespace("c10") public static native @Name("operator +") double add(double a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @Name("operator -") double subtract(double a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @Name("operator *") double multiply(double a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @Name("operator /") double divide(double a, @ByVal Float8_e4m3fnuz b);
+
+/** Arithmetic with ints */
+
+@Namespace("c10") public static native @ByVal @Name("operator +") Float8_e4m3fnuz add(@ByVal Float8_e4m3fnuz a, int b);
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e4m3fnuz subtract(@ByVal Float8_e4m3fnuz a, int b);
+@Namespace("c10") public static native @ByVal @Name("operator *") Float8_e4m3fnuz multiply(@ByVal Float8_e4m3fnuz a, int b);
+@Namespace("c10") public static native @ByVal @Name("operator /") Float8_e4m3fnuz divide(@ByVal Float8_e4m3fnuz a, int b);
+
+@Namespace("c10") public static native @ByVal @Name("operator +") Float8_e4m3fnuz add(int a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e4m3fnuz subtract(int a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator *") Float8_e4m3fnuz multiply(int a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator /") Float8_e4m3fnuz divide(int a, @ByVal Float8_e4m3fnuz b);
+
+//// Arithmetic with int64_t
+
+@Namespace("c10") public static native @ByVal @Name("operator +") Float8_e4m3fnuz add(@ByVal Float8_e4m3fnuz a, @Cast("int64_t") long b);
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e4m3fnuz subtract(@ByVal Float8_e4m3fnuz a, @Cast("int64_t") long b);
+@Namespace("c10") public static native @ByVal @Name("operator *") Float8_e4m3fnuz multiply(@ByVal Float8_e4m3fnuz a, @Cast("int64_t") long b);
+@Namespace("c10") public static native @ByVal @Name("operator /") Float8_e4m3fnuz divide(@ByVal Float8_e4m3fnuz a, @Cast("int64_t") long b);
+
+@Namespace("c10") public static native @ByVal @Name("operator +") Float8_e4m3fnuz add(@Cast("int64_t") long a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e4m3fnuz subtract(@Cast("int64_t") long a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator *") Float8_e4m3fnuz multiply(@Cast("int64_t") long a, @ByVal Float8_e4m3fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator /") Float8_e4m3fnuz divide(@Cast("int64_t") long a, @ByVal Float8_e4m3fnuz b);
+
+/** NOTE: we do not define comparisons directly and instead rely on the implicit
+ * conversion from c10::Float8_e4m3fnuz to float. */
+
// namespace c10
// namespace std
@@ -4354,8 +4532,6 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// Parsed from c10/util/Float8_e4m3fnuz.h
-///
-///
///
// #pragma once
@@ -4363,13 +4539,11 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
* conversions to standard C types and basic arithmetic operations. Note that
* arithmetic operations are implemented by converting to floating point and
* performing the operation in float32.
- *
* Binary configuration remains the same as Float8_e4m3fn:
* s eeee mmm
* 1 sign bit
* 4 exponent bits
* 3 mantissa bits
- *
* The key differences versus Float8_e4m3fn are:
* bias = 8
* no infinities or negative zero
@@ -4379,9 +4553,9 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
* the existing Float8_e4m3fn implementation. */
// #include
-// #include
// #include
// #include
+// #include
// #if defined(__cplusplus) && (__cplusplus >= 201103L)
// #include
@@ -4393,18 +4567,6 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
-/*
- * Convert a 8-bit floating-point number in fp8 E4M3FNUZ format, in bit
- * representation, to a 32-bit floating-point number in IEEE single-precision
- * format, in bit representation.
- *
- * @note The implementation doesn't use any floating-point operations.
- */
-// #if defined(__CUDA_ARCH__) || defined(__HIP__)
-@Namespace("c10::detail") public static native float fp8e4m3fnuz_to_fp32_value(@Cast("uint8_t") byte arg0);
-// #else
-// #endif
-
/*
* Convert a 32-bit floating-point number in IEEE single-precision format to a
* 8-bit floating-point number in fp8 E4M3FNUZ format, in bit representation.
@@ -4617,7 +4779,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// makes the code both less verbose and potentially more efficient.
// #define COMPLEX_INTEGER_OP_TEMPLATE_CONDITION
// typename std::enable_if_t<
-// std::is_floating_point::value && std::is_integral::value,
+// std::is_floating_point_v && std::is_integral_v,
// int> = 0
// #undef COMPLEX_INTEGER_OP_TEMPLATE_CONDITION
@@ -4694,7 +4856,8 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #if C10_CLANG_HAS_WARNING("-Wimplicit-int-float-conversion")
// #endif
-/** Constructors */
+// #if defined(__aarch64__) && !defined(C10_MOBILE) && !defined(__CUDACC__)
+// #else
@@ -4702,6 +4865,9 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
+// #endif /* !defined(__aarch64__) || defined(C10_MOBILE) || defined(__CUDACC__) \
+// */
+
// #if defined(__CUDACC__) || defined(__HIPCC__)
// #endif
@@ -4818,8 +4984,8 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
* If you are writing a compute bound kernel, you can use the CUDA half
* intrinsics directly on the Half type from device code. */
+// #include
// #include
-// #include
// #include
// #include
// #include
@@ -4827,25 +4993,18 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #if defined(__cplusplus) && (__cplusplus >= 201103L)
// #include
-// #include
// #elif !defined(__OPENCL_VERSION__)
// #include
-// #include
// #endif
// #ifdef _MSC_VER
// #include
// #endif
-// #include
// #include
// #include
// #include
// #include
-// #include
-// #include
-// #include
-// #include
// #ifdef __CUDACC__
// #include
@@ -4861,7 +5020,8 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include // for SYCL 2020
// #endif
-// #include // operator typeid
+// #if defined(__aarch64__) && !defined(C10_MOBILE) && !defined(__CUDACC__)
+// #endif
/*
* Convert a 16-bit floating-point number in IEEE half-precision format, in bit
@@ -4894,6 +5054,9 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
*/
@Namespace("c10::detail") public static native @Cast("uint16_t") short fp16_ieee_from_fp32_value(float f);
+// #if defined(__aarch64__) && !defined(C10_MOBILE) && !defined(__CUDACC__)
+// #endif
+
// Targeting ../Half.java
@@ -5119,6 +5282,8 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #pragma once
// #include
+// #include
+// #include
// #include
// #if C10_CLANG_HAS_WARNING("-Wimplicit-int-float-conversion")
@@ -5136,6 +5301,102 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
+
+
+/** Arithmetic */
+
+@Namespace("c10") public static native @ByVal @Name("operator +") Float8_e5m2fnuz add(@Const @ByRef Float8_e5m2fnuz a, @Const @ByRef Float8_e5m2fnuz b);
+
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e5m2fnuz subtract(@Const @ByRef Float8_e5m2fnuz a, @Const @ByRef Float8_e5m2fnuz b);
+
+@Namespace("c10") public static native @ByVal @Name("operator *") Float8_e5m2fnuz multiply(@Const @ByRef Float8_e5m2fnuz a, @Const @ByRef Float8_e5m2fnuz b);
+
+@Namespace("c10") public static native @ByVal @Name("operator /") Float8_e5m2fnuz divide(
+ @Const @ByRef Float8_e5m2fnuz a,
+ @Const @ByRef Float8_e5m2fnuz b);
+
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e5m2fnuz subtract(@Const @ByRef Float8_e5m2fnuz a);
+
+@Namespace("c10") public static native @ByRef @Name("operator +=") Float8_e5m2fnuz addPut(
+ @ByRef Float8_e5m2fnuz a,
+ @Const @ByRef Float8_e5m2fnuz b);
+
+@Namespace("c10") public static native @ByRef @Name("operator -=") Float8_e5m2fnuz subtractPut(
+ @ByRef Float8_e5m2fnuz a,
+ @Const @ByRef Float8_e5m2fnuz b);
+
+@Namespace("c10") public static native @ByRef @Name("operator *=") Float8_e5m2fnuz multiplyPut(
+ @ByRef Float8_e5m2fnuz a,
+ @Const @ByRef Float8_e5m2fnuz b);
+
+@Namespace("c10") public static native @ByRef @Name("operator /=") Float8_e5m2fnuz dividePut(
+ @ByRef Float8_e5m2fnuz a,
+ @Const @ByRef Float8_e5m2fnuz b);
+
+/** Arithmetic with floats */
+
+@Namespace("c10") public static native @Name("operator +") float add(@ByVal Float8_e5m2fnuz a, float b);
+@Namespace("c10") public static native @Name("operator -") float subtract(@ByVal Float8_e5m2fnuz a, float b);
+@Namespace("c10") public static native @Name("operator *") float multiply(@ByVal Float8_e5m2fnuz a, float b);
+@Namespace("c10") public static native @Name("operator /") float divide(@ByVal Float8_e5m2fnuz a, float b);
+
+@Namespace("c10") public static native @Name("operator +") float add(float a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @Name("operator -") float subtract(float a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @Name("operator *") float multiply(float a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @Name("operator /") float divide(float a, @ByVal Float8_e5m2fnuz b);
+
+@Namespace("c10") public static native @ByRef @Name("operator +=") FloatPointer addPut(@ByRef FloatPointer a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator +=") FloatBuffer addPut(@ByRef FloatBuffer a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator +=") float[] addPut(@ByRef float[] a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator -=") FloatPointer subtractPut(@ByRef FloatPointer a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator -=") FloatBuffer subtractPut(@ByRef FloatBuffer a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator -=") float[] subtractPut(@ByRef float[] a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator *=") FloatPointer multiplyPut(@ByRef FloatPointer a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator *=") FloatBuffer multiplyPut(@ByRef FloatBuffer a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator *=") float[] multiplyPut(@ByRef float[] a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator /=") FloatPointer dividePut(@ByRef FloatPointer a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator /=") FloatBuffer dividePut(@ByRef FloatBuffer a, @Const @ByRef Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByRef @Name("operator /=") float[] dividePut(@ByRef float[] a, @Const @ByRef Float8_e5m2fnuz b);
+
+/** Arithmetic with doubles */
+
+@Namespace("c10") public static native @Name("operator +") double add(@ByVal Float8_e5m2fnuz a, double b);
+@Namespace("c10") public static native @Name("operator -") double subtract(@ByVal Float8_e5m2fnuz a, double b);
+@Namespace("c10") public static native @Name("operator *") double multiply(@ByVal Float8_e5m2fnuz a, double b);
+@Namespace("c10") public static native @Name("operator /") double divide(@ByVal Float8_e5m2fnuz a, double b);
+
+@Namespace("c10") public static native @Name("operator +") double add(double a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @Name("operator -") double subtract(double a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @Name("operator *") double multiply(double a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @Name("operator /") double divide(double a, @ByVal Float8_e5m2fnuz b);
+
+/** Arithmetic with ints */
+
+@Namespace("c10") public static native @ByVal @Name("operator +") Float8_e5m2fnuz add(@ByVal Float8_e5m2fnuz a, int b);
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e5m2fnuz subtract(@ByVal Float8_e5m2fnuz a, int b);
+@Namespace("c10") public static native @ByVal @Name("operator *") Float8_e5m2fnuz multiply(@ByVal Float8_e5m2fnuz a, int b);
+@Namespace("c10") public static native @ByVal @Name("operator /") Float8_e5m2fnuz divide(@ByVal Float8_e5m2fnuz a, int b);
+
+@Namespace("c10") public static native @ByVal @Name("operator +") Float8_e5m2fnuz add(int a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e5m2fnuz subtract(int a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator *") Float8_e5m2fnuz multiply(int a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator /") Float8_e5m2fnuz divide(int a, @ByVal Float8_e5m2fnuz b);
+
+//// Arithmetic with int64_t
+
+@Namespace("c10") public static native @ByVal @Name("operator +") Float8_e5m2fnuz add(@ByVal Float8_e5m2fnuz a, @Cast("int64_t") long b);
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e5m2fnuz subtract(@ByVal Float8_e5m2fnuz a, @Cast("int64_t") long b);
+@Namespace("c10") public static native @ByVal @Name("operator *") Float8_e5m2fnuz multiply(@ByVal Float8_e5m2fnuz a, @Cast("int64_t") long b);
+@Namespace("c10") public static native @ByVal @Name("operator /") Float8_e5m2fnuz divide(@ByVal Float8_e5m2fnuz a, @Cast("int64_t") long b);
+
+@Namespace("c10") public static native @ByVal @Name("operator +") Float8_e5m2fnuz add(@Cast("int64_t") long a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator -") Float8_e5m2fnuz subtract(@Cast("int64_t") long a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator *") Float8_e5m2fnuz multiply(@Cast("int64_t") long a, @ByVal Float8_e5m2fnuz b);
+@Namespace("c10") public static native @ByVal @Name("operator /") Float8_e5m2fnuz divide(@Cast("int64_t") long a, @ByVal Float8_e5m2fnuz b);
+
+/** NOTE: we do not define comparisons directly and instead rely on the implicit
+ * conversion from c10::Float8_e5m2fnuz to float. */
+
// namespace c10
// namespace std
@@ -5145,8 +5406,6 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// Parsed from c10/util/Float8_e5m2fnuz.h
-///
-///
///
// #pragma once
@@ -5154,13 +5413,11 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
* conversions to standard C types and basic arithmetic operations. Note that
* arithmetic operations are implemented by converting to floating point and
* performing the operation in float32.
- *
* Binary configuration remains the same as e5m2:
* s eeeee mm
* 1 sign bit
* 5 exponent bits
* 2 mantissa bits
- *
* The key differences that e5m2fnuz brings are:
* bias = 16
* no infinities or negative zero
@@ -5170,7 +5427,6 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
* the existing Float8_e4m3fn implementation. */
// #include
-// #include
// #include
// #include
@@ -5184,18 +5440,6 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
-/*
- * Convert a 8-bit floating-point number in fp8 E5M2FNUZ format, in bit
- * representation, to a 32-bit floating-point number in IEEE single-precision
- * format, in bit representation.
- *
- * @note The implementation doesn't use any floating-point operations.
- */
-// #if defined(__CUDA_ARCH__) || defined(__HIP__)
-@Namespace("c10::detail") public static native float fp8e5m2fnuz_to_fp32_value(@Cast("uint8_t") byte arg0);
-// #else
-// #endif
-
/*
* Convert a 32-bit floating-point number in IEEE single-precision format to a
* 8-bit floating-point number in fp8 E5M2 format, in bit representation.
@@ -5327,16 +5571,34 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
-// #include
+// #include
// #include
+// #include
// #include
+// #include
+
+// dummy struct for uint1 to uint7, actual functionality
+// of these dtypes will be implemented in python with Tensor subclass
// For the macros below:
-// NB: If you want to macro some code for all non-QInt scalar types (i.e. types
-// with complete information, you probably want one of the
-// AT_FORALL_SCALAR_TYPES / AT_FORALL_SCALAR_TYPES_AND
-// macros below, which are designed to behave similarly to the Dispatch macros
-// with the same name.
+//
+// For users: If you want to macro some code for all non-QInt scalar types
+// (i.e. types with complete information, you probably want one of the
+// AT_FORALL_SCALAR_TYPES / AT_FORALL_SCALAR_TYPES_AND macros below, which are
+// designed to behave similarly to the Dispatch macros with the same name.
+//
+// For adding a new dtype: In the beginning, we had an idea that there was a
+// list of all scalar types, and you could use AT_FORALL_SCALAR_TYPES to
+// iterate over them. But over the years we added weird types which couldn't
+// be handled uniformly everywhere and so in the end we ended up with some
+// mish-mosh of some helper macros, but mostly use sites making a call about
+// what dtypes they can or can't support. So if you want to add a new dtype,
+// the preferred resolution is to find a dtype similar to what you want,
+// grep for it and edit all the sites you find this way. If you need to add
+// a completely new kind of dtype, you're going to have to laboriously audit
+// all of the sites everywhere to figure out how it should work. Consulting
+// some old PRs where we added new dtypes (check history of this file) can
+// help give you an idea where to start.
// NB: Order matters for this macro; it is relied upon in
// _promoteTypesLookup and the serialization format.
@@ -5368,10 +5630,24 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// _(c10::Float8_e4m3fn, Float8_e4m3fn) /* 24 */
// _(c10::Float8_e5m2fnuz, Float8_e5m2fnuz) /* 25 */
// _(c10::Float8_e4m3fnuz, Float8_e4m3fnuz) /* 26 */
+// _(uint16_t, UInt16) /* 27 */
+// _(uint32_t, UInt32) /* 28 */
+// _(uint64_t, UInt64) /* 29 */
+// _(c10::dummy_uint1_7_t<1>, UInt1) /* 30 */
+// _(c10::dummy_uint1_7_t<2>, UInt2) /* 31 */
+// _(c10::dummy_uint1_7_t<3>, UInt3) /* 32 */
+// _(c10::dummy_uint1_7_t<4>, UInt4) /* 33 */
+// _(c10::dummy_uint1_7_t<5>, UInt5) /* 34 */
+// _(c10::dummy_uint1_7_t<6>, UInt6) /* 35 */
+// _(c10::dummy_uint1_7_t<7>, UInt7) /* 36 */
// If you want to support ComplexHalf for real, add ComplexHalf
// into this macro (and change the name). But beware: convert()
// doesn't work for all the conversions you need...
+//
+// TODO: To add unsigned int types here, we must define accumulate type.
+// But uint8 currently accumulates into int64, so we would have to make
+// an inconsistent choice for the larger types. Difficult.
// #define AT_FORALL_SCALAR_TYPES_WITH_COMPLEX_EXCEPT_COMPLEX_HALF_F8NZ(_)
// _(uint8_t, Byte)
// _(int8_t, Char)
@@ -5388,6 +5664,8 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// _(at::Float8_e5m2, Float8_e5m2)
// _(at::Float8_e4m3fn, Float8_e4m3fn)
+// This macro controls many of our C++ APIs, including constructors
+// for Scalar as well as the data() and item() accessors on Tensor
// #define AT_FORALL_SCALAR_TYPES_WITH_COMPLEX(_)
// _(uint8_t, Byte)
// _(int8_t, Char)
@@ -5434,9 +5712,19 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
Float8_e5m2((byte)(23)), /* 23 */
Float8_e4m3fn((byte)(24)), /* 24 */
Float8_e5m2fnuz((byte)(25)), /* 25 */
- Float8_e4m3fnuz((byte)(26)),
- Undefined((byte)(27)),
- NumOptions((byte)(28));
+ Float8_e4m3fnuz((byte)(26)), /* 26 */
+ UInt16((byte)(27)), /* 27 */
+ UInt32((byte)(28)), /* 28 */
+ UInt64((byte)(29)), /* 29 */
+ UInt1((byte)(30)), /* 30 */
+ UInt2((byte)(31)), /* 31 */
+ UInt3((byte)(32)), /* 32 */
+ UInt4((byte)(33)), /* 33 */
+ UInt5((byte)(34)), /* 34 */
+ UInt6((byte)(35)), /* 35 */
+ UInt7((byte)(36)),
+ Undefined((byte)(37)),
+ NumOptions((byte)(38));
public final byte value;
private ScalarType(byte v) { this.value = v; }
@@ -5462,7 +5750,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// /* https://gist.github.com/izdeby/952ae7cf256ddb740a73776d39a7e7ba */
// /* TODO: remove once the bug is fixed. */
// static type t;
-// }; /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* 10 */ /* 11 */ /* 12 */ /* 13 */ /* 14 */ /* 15 */ /* 16 */ /* 17 */ /* 18 */ /* 19 */ /* 20 */ /* 21 */ /* 22 */ /* 23 */ /* 24 */ /* 25 */ /* 26 */
+// }; /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* 10 */ /* 11 */ /* 12 */ /* 13 */ /* 14 */ /* 15 */ /* 16 */ /* 17 */ /* 18 */ /* 19 */ /* 20 */ /* 21 */ /* 22 */ /* 23 */ /* 24 */ /* 25 */ /* 26 */ /* 27 */ /* 28 */ /* 29 */ /* 30 */ /* 31 */ /* 32 */ /* 33 */ /* 34 */ /* 35 */ /* 36 */
// #undef SPECIALIZE_ScalarTypeToCPPType
@@ -5473,10 +5761,12 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// struct CppTypeToScalarType
// : std::
// integral_constant {
-// }; /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* 10 */ /* 11 */ /* 12 */ /* 13 */ /* 14 */ /* 15 */ /* 16 */ /* 17 */ /* 18 */ /* 19 */ /* 20 */ /* 21 */ /* 22 */ /* 23 */ /* 24 */ /* 25 */ /* 26 */
+// }; /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* 10 */ /* 11 */ /* 12 */ /* 13 */ /* 14 */ /* 15 */ /* 16 */ /* 17 */ /* 18 */ /* 19 */ /* 20 */ /* 21 */ /* 22 */ /* 23 */ /* 24 */ /* 25 */ /* 26 */ /* 27 */ /* 28 */ /* 29 */ /* 30 */ /* 31 */ /* 32 */ /* 33 */ /* 34 */ /* 35 */ /* 36 */
// #undef SPECIALIZE_CppTypeToScalarType
+// NB: despite its generic sounding name, the macros that don't take _AND
+// are mostly only used by tensorexpr
// #define AT_FORALL_INT_TYPES(_)
// _(uint8_t, Byte)
// _(int8_t, Char)
@@ -5493,6 +5783,11 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// _(float, Float)
// _(double, Double)
+// These macros are often controlling how many template instantiations we
+// create for kernels. It is typically inappropriate to add new dtypes here,
+// instead, new types should be added to use sites on a case-by-case basis.
+// We generally are not accepting new dtypes due to binary size concerns.
+
// #define AT_FORALL_SCALAR_TYPES_AND(SCALARTYPE, _)
// _(uint8_t, Byte)
// _(int8_t, Char)
@@ -5671,6 +5966,7 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #define DEFINE_CONSTANT(_, name)
// constexpr ScalarType k##name = ScalarType::name;
+// NOLINTNEXTLINE(clang-diagnostic-unused-const-variable)
@Namespace("c10") @MemberGetter public static native ScalarType kByte(); /* 0 */
@Namespace("c10") @MemberGetter public static native ScalarType kChar(); /* 1 */
@Namespace("c10") @MemberGetter public static native ScalarType kShort(); /* 2 */
@@ -5698,6 +5994,16 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
@Namespace("c10") @MemberGetter public static native ScalarType kFloat8_e4m3fn(); /* 24 */
@Namespace("c10") @MemberGetter public static native ScalarType kFloat8_e5m2fnuz(); /* 25 */
@Namespace("c10") @MemberGetter public static native ScalarType kFloat8_e4m3fnuz(); /* 26 */
+ @Namespace("c10") @MemberGetter public static native ScalarType kUInt16(); /* 27 */
+ @Namespace("c10") @MemberGetter public static native ScalarType kUInt32(); /* 28 */
+ @Namespace("c10") @MemberGetter public static native ScalarType kUInt64(); /* 29 */
+ @Namespace("c10") @MemberGetter public static native ScalarType kUInt1(); /* 30 */
+ @Namespace("c10") @MemberGetter public static native ScalarType kUInt2(); /* 31 */
+ @Namespace("c10") @MemberGetter public static native ScalarType kUInt3(); /* 32 */
+ @Namespace("c10") @MemberGetter public static native ScalarType kUInt4(); /* 33 */
+ @Namespace("c10") @MemberGetter public static native ScalarType kUInt5(); /* 34 */
+ @Namespace("c10") @MemberGetter public static native ScalarType kUInt6(); /* 35 */
+ @Namespace("c10") @MemberGetter public static native ScalarType kUInt7(); /* 36 */
// #undef DEFINE_CONSTANT
@Namespace("c10") public static native @Cast("const char*") BytePointer toString(ScalarType t);
@@ -5720,6 +6026,8 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
@Namespace("c10") public static native @Cast("bool") boolean isBitsType(ScalarType t);
+@Namespace("c10") public static native @Cast("bool") boolean isBarebonesUnsignedType(ScalarType t);
+
@Namespace("c10") public static native ScalarType toQIntType(ScalarType t);
@Namespace("c10") public static native ScalarType toUnderlying(ScalarType t);
@@ -5745,25 +6053,16 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// namespace c10
-// Parsed from c10/util/in_place.h
-
-// #pragma once
-
-// #include
-
- // namespace c10
-
-
// Parsed from c10/util/MaybeOwned.h
// #pragma once
// #include
// #include
-// #include
// #include
// #include
+// #include
/** MaybeOwnedTraits describes how to borrow from T. Here is how we
* can implement borrowing from an arbitrary type T using a raw
@@ -5794,6 +6093,9 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
// #include
+// #include
+// #include
+// #include
// Targeting ../SymNodeImpl.java
@@ -5807,11 +6109,15 @@ public class torch extends org.bytedeco.pytorch.presets.torch {
// #include
// #include
+// #include
// #include
// #include
// #include
+// #include
// #include
+// #include