Added a large number of low-level PyTorch wrapper nodes.

This commit is contained in:
HowToSD
2025-02-26 19:39:04 -08:00
parent 79897eedf4
commit 8e36913138
158 changed files with 4540 additions and 52 deletions
+126
View File
@@ -118,16 +118,58 @@ from .modules.pandas_wrapper.pandas_var import PandasVar
from .modules.pandas_wrapper.pandas_vertical_concat import PandasVerticalConcat
from .modules.pandas_wrapper.pandas_vertical_split import PandasVerticalSplit
from .modules.pandas_wrapper.pandas_xs import PandasXs
from .modules.pytorch_wrapper.pt_abs import PtAbs
from .modules.pytorch_wrapper.pt_acos import PtAcos
from .modules.pytorch_wrapper.pt_add import PtAdd
from .modules.pytorch_wrapper.pt_asin import PtAsin
from .modules.pytorch_wrapper.pt_atan import PtAtan
from .modules.pytorch_wrapper.pt_bitwise_and import PtBitwiseAnd
from .modules.pytorch_wrapper.pt_bitwise_left_shift import PtBitwiseLeftShift
from .modules.pytorch_wrapper.pt_bitwise_not import PtBitwiseNot
from .modules.pytorch_wrapper.pt_bitwise_or import PtBitwiseOr
from .modules.pytorch_wrapper.pt_bitwise_right_shift import PtBitwiseRightShift
from .modules.pytorch_wrapper.pt_bitwise_xor import PtBitwiseXor
from .modules.pytorch_wrapper.pt_bmm import PtBmm
from .modules.pytorch_wrapper.pt_bool_create import PtBoolCreate
from .modules.pytorch_wrapper.pt_cos import PtCos
from .modules.pytorch_wrapper.pt_cosh import PtCosh
from .modules.pytorch_wrapper.pt_div import PtDiv
from .modules.pytorch_wrapper.pt_einsum import PtEinsum
from .modules.pytorch_wrapper.pt_eq import PtEq
from .modules.pytorch_wrapper.pt_exp import PtExp
from .modules.pytorch_wrapper.pt_flatten import PtFlatten
from .modules.pytorch_wrapper.pt_float_create import PtFloatCreate
from .modules.pytorch_wrapper.pt_floor_divide import PtFloorDiv
from .modules.pytorch_wrapper.pt_from_image import PtFromImage
from .modules.pytorch_wrapper.pt_from_latent import PtFromLatent
from .modules.pytorch_wrapper.pt_from_numpy import PtFromNumpy
from .modules.pytorch_wrapper.pt_ge import PtGe
from .modules.pytorch_wrapper.pt_gt import PtGt
from .modules.pytorch_wrapper.pt_int_create import PtIntCreate
from .modules.pytorch_wrapper.pt_le import PtLe
from .modules.pytorch_wrapper.pt_log import PtLog
from .modules.pytorch_wrapper.pt_logical_and import PtLogicalAnd
from .modules.pytorch_wrapper.pt_logical_not import PtLogicalNot
from .modules.pytorch_wrapper.pt_logical_or import PtLogicalOr
from .modules.pytorch_wrapper.pt_logical_xor import PtLogicalXor
from .modules.pytorch_wrapper.pt_lt import PtLt
from .modules.pytorch_wrapper.pt_matmul import PtMatMul
from .modules.pytorch_wrapper.pt_mm import PtMm
from .modules.pytorch_wrapper.pt_mul import PtMul
from .modules.pytorch_wrapper.pt_ne import PtNe
from .modules.pytorch_wrapper.pt_neg import PtNeg
from .modules.pytorch_wrapper.pt_pow import PtPow
from .modules.pytorch_wrapper.pt_remainder import PtRemainder
from .modules.pytorch_wrapper.pt_show_text import PtShowText
from .modules.pytorch_wrapper.pt_sin import PtSin
from .modules.pytorch_wrapper.pt_sinh import PtSinh
from .modules.pytorch_wrapper.pt_size import PtSize
from .modules.pytorch_wrapper.pt_size_create import PtSizeCreate
from .modules.pytorch_wrapper.pt_size_to_numpy import PtSizeToNumpy
from .modules.pytorch_wrapper.pt_size_to_string import PtSizeToString
from .modules.pytorch_wrapper.pt_sub import PtSub
from .modules.pytorch_wrapper.pt_tan import PtTan
from .modules.pytorch_wrapper.pt_tanh import PtTanh
from .modules.pytorch_wrapper.pt_to_image import PtToImage
from .modules.pytorch_wrapper.pt_to_latent import PtToLatent
from .modules.pytorch_wrapper.pt_to_numpy import PtToNumpy
@@ -261,16 +303,58 @@ NODE_CLASS_MAPPINGS: Dict[str, Type[T]] = {
"PandasVerticalConcat": PandasVerticalConcat,
"PandasVerticalSplit": PandasVerticalSplit,
"PandasXs": PandasXs,
"PtAbs": PtAbs,
"PtAcos": PtAcos,
"PtAdd": PtAdd,
"PtAsin": PtAsin,
"PtAtan": PtAtan,
"PtBitwiseAnd": PtBitwiseAnd,
"PtBitwiseLeftShift": PtBitwiseLeftShift,
"PtBitwiseNot": PtBitwiseNot,
"PtBitwiseOr": PtBitwiseOr,
"PtBitwiseRightShift": PtBitwiseRightShift,
"PtBitwiseXor": PtBitwiseXor,
"PtBmm": PtBmm,
"PtBoolCreate": PtBoolCreate,
"PtCos": PtCos,
"PtCosh": PtCosh,
"PtDiv": PtDiv,
"PtEinsum": PtEinsum,
"PtEq": PtEq,
"PtExp": PtExp,
"PtFlatten": PtFlatten,
"PtFloatCreate": PtFloatCreate,
"PtFloorDiv": PtFloorDiv,
"PtFromImage": PtFromImage,
"PtFromLatent": PtFromLatent,
"PtFromNumpy": PtFromNumpy,
"PtGe": PtGe,
"PtGt": PtGt,
"PtIntCreate": PtIntCreate,
"PtLe": PtLe,
"PtLog": PtLog,
"PtLogicalAnd": PtLogicalAnd,
"PtLogicalNot": PtLogicalNot,
"PtLogicalOr": PtLogicalOr,
"PtLogicalXor": PtLogicalXor,
"PtLt": PtLt,
"PtMatMul": PtMatMul,
"PtMm": PtMm,
"PtMul": PtMul,
"PtNe": PtNe,
"PtNeg": PtNeg,
"PtPow": PtPow,
"PtRemainder": PtRemainder,
"PtShowText": PtShowText,
"PtSin": PtSin,
"PtSinh": PtSinh,
"PtSize": PtSize,
"PtSizeCreate": PtSizeCreate,
"PtSizeToNumpy": PtSizeToNumpy,
"PtSizeToString": PtSizeToString,
"PtSub": PtSub,
"PtTan": PtTan,
"PtTanh": PtTanh,
"PtToImage": PtToImage,
"PtToLatent": PtToLatent,
"PtToNumpy": PtToNumpy,
@@ -407,16 +491,58 @@ NODE_DISPLAY_NAME_MAPPINGS: Dict[str, str] = {
"PandasVerticalConcat": "Pandas Vertical Concat",
"PandasVerticalSplit": "Pandas Vertical Split",
"PandasXs": "Pandas Xs",
"PtAbs": "Pt Abs",
"PtAcos": "Pt Acos",
"PtAdd": "Pt Add",
"PtAsin": "Pt Asin",
"PtAtan": "Pt Atan",
"PtBitwiseAnd": "Pt Bitwise And",
"PtBitwiseLeftShift": "Pt Bitwise Left Shift",
"PtBitwiseNot": "Pt Bitwise Not",
"PtBitwiseOr": "Pt Bitwise Or",
"PtBitwiseRightShift": "Pt Bitwise Right Shift",
"PtBitwiseXor": "Pt Bitwise Xor",
"PtBmm": "Pt Bmm",
"PtBoolCreate": "Pt Bool Create",
"PtCos": "Pt Cos",
"PtCosh": "Pt Cosh",
"PtDiv": "Pt Div",
"PtEinsum": "Pt Einsum",
"PtEq": "Pt Eq",
"PtExp": "Pt Exp",
"PtFlatten": "Pt Flatten",
"PtFloatCreate": "Pt Float Create",
"PtFloorDiv": "Pt Floor Div",
"PtFromImage": "Pt From Image",
"PtFromLatent": "Pt From Latent",
"PtFromNumpy": "Pt From Numpy",
"PtGe": "Pt Ge",
"PtGt": "Pt Gt",
"PtIntCreate": "Pt Int Create",
"PtLe": "Pt Le",
"PtLog": "Pt Log",
"PtLogicalAnd": "Pt Logical And",
"PtLogicalNot": "Pt Logical Not",
"PtLogicalOr": "Pt Logical Or",
"PtLogicalXor": "Pt Logical Xor",
"PtLt": "Pt Lt",
"PtMatMul": "Pt Mat Mul",
"PtMm": "Pt Mm",
"PtMul": "Pt Mul",
"PtNe": "Pt Ne",
"PtNeg": "Pt Neg",
"PtPow": "Pt Pow",
"PtRemainder": "Pt Remainder",
"PtShowText": "Pt Show Text",
"PtSin": "Pt Sin",
"PtSinh": "Pt Sinh",
"PtSize": "Pt Size",
"PtSizeCreate": "Pt Size Create",
"PtSizeToNumpy": "Pt Size To Numpy",
"PtSizeToString": "Pt Size To String",
"PtSub": "Pt Sub",
"PtTan": "Pt Tan",
"PtTanh": "Pt Tanh",
"PtToImage": "Pt To Image",
"PtToLatent": "Pt To Latent",
"PtToNumpy": "Pt To Numpy",
+72 -6
View File
@@ -89,6 +89,7 @@
| [Pandas Show Series](pandas_show_series.md) | Displays a Pandas Series as text. |
| [Pandas Show Text](pandas_show_text.md) | Displays a string. |
| [Pandas To String](pandas_to_string.md) | Converts a pandas DataFrame to a string representation. |
| [Pt Show Text](pt_show_text.md) | Displays PyTorch tensor as a string. Note that the tensor is partially printed out when |
## IO
| Node | Description |
| --- | --- |
@@ -122,7 +123,6 @@
| Node | Description |
| --- | --- |
| [Pt Flatten](pt_flatten.md) | Flattens a PyTorch tensor into a 1D tensor. |
| [Pt To Rgb Tensors](pt_to_rgb_tensors.md) | Splits a PyTorch tensor into R, G, and B tensors. |
## Numpy
| Node | Description |
| --- | --- |
@@ -140,21 +140,87 @@
| [SNS Histogram](sns_histogram.md) | Generates a histogram from a Pandas DataFrame using Seaborn. |
| [SNS Line Plot](sns_line.md) | Generates a line plot from a pandas DataFrame using Seaborn. |
| [SNS Scatter Plot](sns_scatter.md) | Generates a scatter plot from a pandas DataFrame using Seaborn. |
## PyTorch wrapper
## PyTorch wrapper - Arithmetic operations
| Node | Description |
| --- | --- |
| [Pt Add](pt_add.md) | Adds two PyTorch tensors. |
| [Pt Div](pt_div.md) | Divides one PyTorch tensor by another element-wise. |
| [Pt Floor Div](pt_floor_divide.md) | Performs element-wise floor division on two PyTorch tensors. |
| [Pt Mul](pt_mul.md) | Multiplies two PyTorch tensors element-wise. |
| [Pt Pow](pt_pow.md) | Raises one PyTorch tensor to the power of another element-wise. |
| [Pt Remainder](pt_remainder.md) | Computes the element-wise remainder of division between two PyTorch tensors. |
| [Pt Sub](pt_sub.md) | Subtracts one PyTorch tensor from another. |
## PyTorch wrapper - Bitwise operations
| Node | Description |
| --- | --- |
| [Pt Bitwise And](pt_bitwise_and.md) | Performs a bitwise AND operation on two PyTorch tensors element-wise. |
| [Pt Bitwise Left Shift](pt_bitwise_left_shift.md) | Performs a bitwise left shift operation on two PyTorch tensors element-wise. |
| [Pt Bitwise Not](pt_bitwise_not.md) | Performs a bitwise NOT operation on a PyTorch tensor element-wise. |
| [Pt Bitwise Or](pt_bitwise_or.md) | Performs a bitwise OR operation on two PyTorch tensors element-wise. |
| [Pt Bitwise Right Shift](pt_bitwise_right_shift.md) | Performs a bitwise right shift operation on two PyTorch tensors element-wise. |
| [Pt Bitwise Xor](pt_bitwise_xor.md) | Performs a bitwise XOR operation on two PyTorch tensors element-wise. |
## PyTorch wrapper - Comparison operations
| Node | Description |
| --- | --- |
| [Pt Eq](pt_eq.md) | Tests whether two PyTorch tensors are equal element-wise. |
| [Pt Ge](pt_ge.md) | Tests whether elements in the first PyTorch tensor are greater than or equal to the corresponding elements in the second tensor. |
| [Pt Gt](pt_gt.md) | Tests whether elements in the first PyTorch tensor are greater than the corresponding elements in the second tensor. |
| [Pt Le](pt_le.md) | Tests whether elements in the first PyTorch tensor are less than or equal to the corresponding elements in the second tensor. |
| [Pt Lt](pt_lt.md) | Tests whether elements in the first PyTorch tensor are less than the corresponding elements in the second tensor. |
| [Pt Ne](pt_ne.md) | Tests whether two PyTorch tensors are not equal element-wise. |
## PyTorch wrapper - Logical operations
| Node | Description |
| --- | --- |
| [Pt Logical And](pt_logical_and.md) | Performs a logical AND operation on two PyTorch tensors element-wise. |
| [Pt Logical Not](pt_logical_not.md) | Performs a logical NOT operation on a PyTorch tensor element-wise. |
| [Pt Logical Or](pt_logical_or.md) | Performs a logical OR operation on two PyTorch tensors element-wise. |
| [Pt Logical Xor](pt_logical_xor.md) | Performs a logical XOR operation on two PyTorch tensors element-wise. |
## PyTorch wrapper - Math operations
| Node | Description |
| --- | --- |
| [Pt Abs](pt_abs.md) | Computes the absolute value of each element in a PyTorch tensor. |
| [Pt Acos](pt_acos.md) | Computes the arccosine (inverse cosine) of a PyTorch tensor element-wise. |
| [Pt Asin](pt_asin.md) | Computes the arcsine (inverse sine) of a PyTorch tensor element-wise. |
| [Pt Atan](pt_atan.md) | Computes the arc tangent (inverse tangent) of a PyTorch tensor element-wise. |
| [Pt Cos](pt_cos.md) | Computes the cosine of a PyTorch tensor element-wise. |
| [Pt Cosh](pt_cosh.md) | Computes the hyperbolic cosine of a PyTorch tensor element-wise. |
| [Pt Exp](pt_exp.md) | Performs an exponential operation on a PyTorch tensor element-wise. |
| [Pt Log](pt_log.md) | Computes the natural logarithm (log base e) of a PyTorch tensor element-wise. |
| [Pt Neg](pt_neg.md) | Computes the negation of each element in a PyTorch tensor. |
| [Pt Sin](pt_sin.md) | Computes the sine of a PyTorch tensor element-wise. |
| [Pt Sinh](pt_sinh.md) | Computes the hyperbolic sine of a PyTorch tensor element-wise. |
| [Pt Tan](pt_tan.md) | Computes the tangent of a PyTorch tensor element-wise. |
| [Pt Tanh](pt_tanh.md) | Computes the hyperbolic tangent of a PyTorch tensor element-wise. |
## PyTorch wrapper - Matrix operations
| Node | Description |
| --- | --- |
| [Pt Bmm](pt_bmm.md) | Performs batched matrix multiplication on two 3D PyTorch tensors. |
| [Pt Einsum](pt_einsum.md) | Performs Tensor operations specified in the Einstein summation equation. |
| [Pt Mat Mul](pt_matmul.md) | Performs matrix multiplication on two PyTorch tensors. |
| [Pt Mm](pt_mm.md) | Performs 2D matrix multiplication on two PyTorch tensors. |
## PyTorch wrapper - Size object support
| Node | Description |
| --- | --- |
| [Pt Size](pt_size.md) | Extracts the PyTorch Size object of a PyTorch tensor using the size() method. |
| [Pt Size Create](pt_size_create.md) | Creates a PyTorch Size using values entered in the text field. |
| [Pt Size To Numpy](pt_size_to_numpy.md) | Converts PyTorch Size object to NumPy ndarray. |
| [Pt Size To String](pt_size_to_string.md) | Converts PyTorch Size object to a Python string. |
## PyTorch wrapper - Tensor creation
| Node | Description |
| --- | --- |
| [Pt Bool Create](pt_bool_create.md) | Creates a PyTorch tensor of dtype bool from True or False values entered as a list in the text field. |
| [Pt Float Create](pt_float_create.md) | Creates a PyTorch tensor with 32-bit floating point precision |
| [Pt From Image](pt_from_image.md) | Casts an Image tensor as a PyTorch tensor. |
| [Pt From Latent](pt_from_latent.md) | Casts a latent tensor as a PyTorch tensor. |
| [Pt From Numpy](pt_from_numpy.md) | Converts a NumPy ndarray to a PyTorch tensor while preserving its data type. |
| [Pt Int Create](pt_int_create.md) | Creates a PyTorch tensor with 32-bit integer |
| [Pt Size](pt_size.md) | Extracts the PyTorch Size object of a PyTorch tensor using the size() method. |
| [Pt Size Create](pt_size_create.md) | Creates a PyTorch Size using values entered in the text field. |
| [Pt Size To Numpy](pt_size_to_numpy.md) | Converts PyTorch Size object to NumPy ndarray. |
| [Pt Size To String](pt_size_to_string.md) | Converts PyTorch Size object to a Python string. |
## PyTorch wrapper - Tensor data conversion
| Node | Description |
| --- | --- |
| [Pt To Image](pt_to_image.md) | Casts a PyTorch tensor as an Image tensor. |
| [Pt To Latent](pt_to_latent.md) | Casts a PyTorch tensor as a latent tensor. |
| [Pt To Numpy](pt_to_numpy.md) | Converts PyTorch tensor to NumPy ndarray. |
| [Pt To Rgb Tensors](pt_to_rgb_tensors.md) | Splits a PyTorch tensor into R, G, and B tensors. |
## Python wrapper
| Node | Description |
| --- | --- |
+17
View File
@@ -0,0 +1,17 @@
# Pt Abs
Computes the absolute value of each element in a PyTorch tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Acos
Computes the arccosine (inverse cosine) of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Add
Adds two PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Asin
Computes the arcsine (inverse sine) of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Atan
Computes the arc tangent (inverse tangent) of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Bitwise And
Performs a bitwise AND operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Bitwise Left Shift
Performs a bitwise left shift operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Bitwise Not
Performs a bitwise NOT operation on a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Bitwise Or
Performs a bitwise OR operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Bitwise Right Shift
Performs a bitwise right shift operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Bitwise Xor
Performs a bitwise XOR operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Bitwise operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Bmm
Performs batched matrix multiplication on two 3D PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Matrix operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+22
View File
@@ -0,0 +1,22 @@
# Pt Bool Create
Creates a PyTorch tensor of dtype bool from True or False values entered as a list in the text field.
For example, entering:
```
[True, False, False]
```
will create a 1D boolean tensor.
## Input
| Name | Data type |
|---|---|
| data | String |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Cos
Computes the cosine of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Cosh
Computes the hyperbolic cosine of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Div
Divides one PyTorch tensor by another element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+26
View File
@@ -0,0 +1,26 @@
# Pt Einsum
Performs Tensor operations specified in the Einstein summation equation.
Specify Einstein summation notation in the first socket.
Specify two tensors in tens_a, tens_b. If you specify the third tensor, specify in tens_c.
Otherwise, leave the socket unconnected.
Sublist format is not supported.
## Input
| Name | Data type |
|---|---|
| equation | String |
| tens_a | Tensor |
| tens_b | Tensor |
| tens_c | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Matrix operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Eq
Tests whether two PyTorch tensors are equal element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Exp
Performs an exponential operation on a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -13,6 +13,6 @@ using values entered in the text field.
| Tensor |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Floor Div
Performs element-wise floor division on two PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -12,6 +12,6 @@ Casts an Image tensor as a PyTorch tensor.
| Tensor |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -12,6 +12,6 @@ Casts a latent tensor as a PyTorch tensor.
| Tensor |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -12,6 +12,6 @@ Converts a NumPy ndarray to a PyTorch tensor while preserving its data type.
| Tensor |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Ge
Tests whether elements in the first PyTorch tensor are greater than or equal to the corresponding elements in the second tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Gt
Tests whether elements in the first PyTorch tensor are greater than the corresponding elements in the second tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -13,6 +13,6 @@ using values entered in the text field.
| Tensor |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Tensor creation
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Le
Tests whether elements in the first PyTorch tensor are less than or equal to the corresponding elements in the second tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Log
Computes the natural logarithm (log base e) of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Logical And
Performs a logical AND operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Logical operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Logical Not
Performs a logical NOT operation on a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Logical operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Logical Or
Performs a logical OR operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Logical operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Logical Xor
Performs a logical XOR operation on two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Logical operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Lt
Tests whether elements in the first PyTorch tensor are less than the corresponding elements in the second tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Mat Mul
Performs matrix multiplication on two PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Matrix operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Mm
Performs 2D matrix multiplication on two PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Matrix operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Mul
Multiplies two PyTorch tensors element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Ne
Tests whether two PyTorch tensors are not equal element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Comparison operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Neg
Computes the negation of each element in a PyTorch tensor.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Pow
Raises one PyTorch tensor to the power of another element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Remainder
Computes the element-wise remainder of division between two PyTorch tensors.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Show Text
Displays PyTorch tensor as a string. Note that the tensor is partially printed out when
the tensor contains more elements than the threshold set internally.
## Input
| Name | Data type |
|---|---|
| tens | Tensor |
## Output
| Data type |
|---|
| String |
<HR>
Category: Display data
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Sin
Computes the sine of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Sinh
Computes the hyperbolic sine of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -12,6 +12,6 @@ Extracts the PyTorch Size object of a PyTorch tensor using the size() method.
| Ptsize |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Size object support
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -12,6 +12,6 @@ Creates a PyTorch Size using values entered in the text field.
| Ptsize |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Size object support
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -12,6 +12,6 @@ Converts PyTorch Size object to NumPy ndarray.
| Ndarray |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Size object support
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -12,6 +12,6 @@ Converts PyTorch Size object to a Python string.
| String |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Size object support
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+18
View File
@@ -0,0 +1,18 @@
# Pt Sub
Subtracts one PyTorch tensor from another.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
| tens_b | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Arithmetic operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Tan
Computes the tangent of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+17
View File
@@ -0,0 +1,17 @@
# Pt Tanh
Computes the hyperbolic tangent of a PyTorch tensor element-wise.
## Input
| Name | Data type |
|---|---|
| tens_a | Tensor |
## Output
| Data type |
|---|
| Tensor |
<HR>
Category: PyTorch wrapper - Math operations
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -12,6 +12,6 @@ Casts a PyTorch tensor as an Image tensor.
| Image |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Tensor data conversion
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -12,6 +12,6 @@ Casts a PyTorch tensor as a latent tensor.
| Latent |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Tensor data conversion
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -12,6 +12,6 @@ Converts PyTorch tensor to NumPy ndarray.
| Ndarray |
<HR>
Category: PyTorch wrapper
Category: PyTorch wrapper - Tensor data conversion
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -3
View File
@@ -1,8 +1,6 @@
# Pt To Rgb Tensors
Splits a PyTorch tensor into R, G, and B tensors.
Category: PyTorch wrapper
## Input
| Name | Data type |
|---|---|
@@ -16,6 +14,6 @@ Category: PyTorch wrapper
| Tensor |
<HR>
Category: Miscellaneous
Category: PyTorch wrapper - Tensor data conversion
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
+1 -1
View File
@@ -27,7 +27,7 @@ class NumpyFloatCreate:
RETURN_TYPES: tuple = ("NDARRAY",)
FUNCTION: str = "f"
CATEGORY: str = "Numpy wrapper"
CATEGORY: str = "Data Analysis"
def f(self, data: str) -> tuple:
"""
+1 -1
View File
@@ -27,7 +27,7 @@ class NumpyIntCreate:
RETURN_TYPES: tuple = ("NDARRAY",)
FUNCTION: str = "f"
CATEGORY: str = "Numpy wrapper"
CATEGORY: str = "Data Analysis"
def f(self, data: str) -> tuple:
"""
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtAbs:
"""
Computes the absolute value of each element in a PyTorch tensor.
category: PyTorch wrapper - Math operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Computes the absolute value of a PyTorch tensor element-wise.
Args:
tens_a (torch.Tensor): A PyTorch tensor of numerical type.
Returns:
tuple: A tuple containing the resultant tensor after applying the absolute function.
"""
return (torch.abs(tens_a),)
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtAcos:
"""
Computes the arccosine (inverse cosine) of a PyTorch tensor element-wise.
category: PyTorch wrapper - Math operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Computes the element-wise arccosine (inverse cosine) of a PyTorch tensor.
Args:
tens_a (torch.Tensor): A PyTorch tensor of numerical type. Values must be in the range [-1, 1].
Returns:
tuple: A tuple containing the resultant tensor after applying the arccosine function.
"""
return (torch.acos(tens_a),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtAdd:
"""
Adds two PyTorch tensors.
category: PyTorch wrapper - Arithmetic operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Adds two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of shape that supports addition with `tens_a`.
Returns:
tuple: A tuple containing the resultant tensor.
"""
return (torch.add(tens_a, tens_b),)
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtAsin:
"""
Computes the arcsine (inverse sine) of a PyTorch tensor element-wise.
category: PyTorch wrapper - Math operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Computes the element-wise arcsine (inverse sine) of a PyTorch tensor.
Args:
tens_a (torch.Tensor): A PyTorch tensor of numerical type. Values must be in the range [-1, 1].
Returns:
tuple: A tuple containing the resultant tensor after applying the arcsine function.
"""
return (torch.asin(tens_a),)
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtAtan:
"""
Computes the arc tangent (inverse tangent) of a PyTorch tensor element-wise.
category: PyTorch wrapper - Math operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Computes the element-wise arc tangent (inverse tangent) of a PyTorch tensor.
Args:
tens_a (torch.Tensor): A PyTorch tensor of numerical type.
Returns:
tuple: A tuple containing the resultant tensor after applying the arc tangent function.
"""
return (torch.atan(tens_a),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtBitwiseAnd:
"""
Performs a bitwise AND operation on two PyTorch tensors element-wise.
category: PyTorch wrapper - Bitwise operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs a bitwise AND operation on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of integer type.
tens_b (torch.Tensor): A PyTorch tensor of the same shape and integer type as `tens_a`.
Returns:
tuple: A tuple containing the resultant tensor after applying bitwise AND.
"""
return (torch.bitwise_and(tens_a, tens_b),)
@@ -0,0 +1,42 @@
from typing import Any, Dict
import torch
class PtBitwiseLeftShift:
"""
Performs a bitwise left shift operation on two PyTorch tensors element-wise.
category: PyTorch wrapper - Bitwise operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs a bitwise left shift operation on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of integer type.
tens_b (torch.Tensor): A PyTorch tensor of the same shape and integer type as `tens_a`,
representing the number of positions to shift.
Returns:
tuple: A tuple containing the resultant tensor after applying bitwise left shift.
"""
return (torch.bitwise_left_shift(tens_a, tens_b),)
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtBitwiseNot:
"""
Performs a bitwise NOT operation on a PyTorch tensor element-wise.
category: PyTorch wrapper - Bitwise operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Performs a bitwise NOT operation on a PyTorch tensor.
Args:
tens_a (torch.Tensor): A PyTorch tensor of integer type.
Returns:
tuple: A tuple containing the resultant tensor after applying bitwise NOT.
"""
return (torch.bitwise_not(tens_a),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtBitwiseOr:
"""
Performs a bitwise OR operation on two PyTorch tensors element-wise.
category: PyTorch wrapper - Bitwise operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs a bitwise OR operation on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of integer type.
tens_b (torch.Tensor): A PyTorch tensor of the same shape and integer type as `tens_a`.
Returns:
tuple: A tuple containing the resultant tensor after applying bitwise OR.
"""
return (torch.bitwise_or(tens_a, tens_b),)
@@ -0,0 +1,42 @@
from typing import Any, Dict
import torch
class PtBitwiseRightShift:
"""
Performs a bitwise right shift operation on two PyTorch tensors element-wise.
category: PyTorch wrapper - Bitwise operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs a bitwise right shift operation on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of integer type.
tens_b (torch.Tensor): A PyTorch tensor of the same shape and integer type as `tens_a`,
representing the number of positions to shift.
Returns:
tuple: A tuple containing the resultant tensor after applying bitwise right shift.
"""
return (torch.bitwise_right_shift(tens_a, tens_b),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtBitwiseXor:
"""
Performs a bitwise XOR operation on two PyTorch tensors element-wise.
category: PyTorch wrapper - Bitwise operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs a bitwise XOR operation on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of integer type.
tens_b (torch.Tensor): A PyTorch tensor of the same shape and integer type as `tens_a`.
Returns:
tuple: A tuple containing the resultant tensor after applying bitwise XOR.
"""
return (torch.bitwise_xor(tens_a, tens_b),)
+44
View File
@@ -0,0 +1,44 @@
from typing import Any, Dict
import torch
class PtBmm:
"""
Performs batched matrix multiplication on two 3D PyTorch tensors.
category: PyTorch wrapper - Matrix operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs batched matrix multiplication on two 3D PyTorch tensors.
Args:
tens_a (torch.Tensor): A 3D PyTorch tensor (batch, m, n).
tens_b (torch.Tensor): A 3D PyTorch tensor (batch, n, p) that supports matrix multiplication with `tens_a`.
Returns:
tuple: A tuple containing the resultant 3D tensor.
"""
if tens_a.dim() != 3 or tens_b.dim() != 3:
raise ValueError("torch.bmm() only supports batch matrix multiplication for 3D tensors.")
return (torch.bmm(tens_a, tens_b),)
+51
View File
@@ -0,0 +1,51 @@
from typing import Any, Dict
import torch
import ast
class PtBoolCreate:
"""
Creates a PyTorch tensor of dtype bool from True or False values entered as a list in the text field.
For example, entering:
```
[True, False, False]
```
will create a 1D boolean tensor.
category: PyTorch wrapper - Tensor creation
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the input types for the function.
Returns:
Dict[str, Any]: A dictionary specifying required input types.
"""
return {
"required": {
"data": ("STRING", {"multiline": True}),
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, data: str) -> tuple:
"""
Creates a PyTorch tensor with bool data type using True or False string values entered in the text field.
Args:
data (str): String value in the text field.
Returns:
tuple: A tuple containing the tensor.
"""
# Convert string to Python list
list_data = ast.literal_eval(data)
# Convert list to PyTorch tensor
tensor = torch.tensor(list_data, dtype=torch.bool)
return (tensor,)
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtCos:
"""
Computes the cosine of a PyTorch tensor element-wise.
category: PyTorch wrapper - Math operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Computes the element-wise cosine of a PyTorch tensor.
Args:
tens_a (torch.Tensor): A PyTorch tensor of numerical type, representing angles in radians.
Returns:
tuple: A tuple containing the resultant tensor after applying the cosine function.
"""
return (torch.cos(tens_a),)
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtCosh:
"""
Computes the hyperbolic cosine of a PyTorch tensor element-wise.
category: PyTorch wrapper - Math operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Computes the element-wise hyperbolic cosine of a PyTorch tensor.
Args:
tens_a (torch.Tensor): A PyTorch tensor of numerical type.
Returns:
tuple: A tuple containing the resultant tensor after applying the hyperbolic cosine function.
"""
return (torch.cosh(tens_a),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtDiv:
"""
Divides one PyTorch tensor by another element-wise.
category: PyTorch wrapper - Arithmetic operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Divides one PyTorch tensor by another element-wise.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of shape that supports element-wise division with `tens_a`.
Returns:
tuple: A tuple containing the resultant tensor.
"""
return (torch.div(tens_a, tens_b),)
+67
View File
@@ -0,0 +1,67 @@
from typing import Any, Dict
import torch
class PtEinsum:
"""
Performs Tensor operations specified in the Einstein summation equation.
Specify Einstein summation notation in the first socket.
Specify two tensors in tens_a, tens_b. If you specify the third tensor, specify in tens_c.
Otherwise, leave the socket unconnected.
Sublist format is not supported.
category: PyTorch wrapper - Matrix operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"equation": ("STRING", {"default": ""}),
"tens_a": ("TENSOR", {})
},
"optional":{
"tens_b": ("TENSOR", {}),
"tens_c": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self,
equation: str,
tens_a: torch.Tensor,
tens_b: torch.Tensor = None,
tens_c: torch.Tensor = None) -> tuple:
"""
Performs Tensor operations specified in the Einstein summation equation.
Args:
equation (str): Einstein summation equation.
tens_a (torch.Tensor): A PyTorch tensor.
tens_b (torch.Tensor): A PyTorch tensor.
tens_c (torch.Tensor): A PyTorch tensor.
Returns:
tuple: A tuple containing the resultant tensor.
"""
if tens_a is None:
raise ValueError("tens_a is None")
if tens_b is None and tens_c is None:
tens_ret_val = torch.einsum(equation, tens_a)
elif tens_c is None:
tens_ret_val = torch.einsum(equation, tens_a, tens_b)
else:
tens_ret_val = torch.einsum(equation, tens_a, tens_b, tens_c)
return (tens_ret_val,)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtEq:
"""
Tests whether two PyTorch tensors are equal element-wise.
category: PyTorch wrapper - Comparison operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Compares two PyTorch tensors for element-wise equality.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of the same shape as `tens_a`.
Returns:
tuple: A tuple containing a boolean tensor indicating element-wise equality.
"""
return (torch.eq(tens_a, tens_b),)
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtExp:
"""
Performs an exponential operation on a PyTorch tensor element-wise.
category: PyTorch wrapper - Math operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Computes the element-wise exponential of a PyTorch tensor.
Args:
tens_a (torch.Tensor): A PyTorch tensor of numerical type.
Returns:
tuple: A tuple containing the resultant tensor after applying the exponential function.
"""
return (torch.exp(tens_a),)
+1 -1
View File
@@ -25,7 +25,7 @@ class PtFlatten:
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "PyTorch wrapper"
CATEGORY: str = "Data Analysis"
def f(self, tens: torch.Tensor) -> tuple:
"""
+2 -2
View File
@@ -8,7 +8,7 @@ class PtFloatCreate:
Creates a PyTorch tensor with 32-bit floating point precision
using values entered in the text field.
category: PyTorch wrapper
category: PyTorch wrapper - Tensor creation
"""
@classmethod
@@ -27,7 +27,7 @@ class PtFloatCreate:
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "PyTorch wrapper"
CATEGORY: str = "Data Analysis"
def f(self, data: str) -> tuple:
"""
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtFloorDiv:
"""
Performs element-wise floor division on two PyTorch tensors.
category: PyTorch wrapper - Arithmetic operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs element-wise floor division on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of shape that supports element-wise floor division with `tens_a`.
Returns:
tuple: A tuple containing the resultant tensor.
"""
return (torch.floor_divide(tens_a, tens_b),)
+2 -2
View File
@@ -6,7 +6,7 @@ class PtFromImage:
"""
Casts an Image tensor as a PyTorch tensor.
category: PyTorch wrapper
category: PyTorch wrapper - Tensor creation
"""
@classmethod
@@ -25,7 +25,7 @@ class PtFromImage:
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "PyTorch wrapper"
CATEGORY: str = "Data Analysis"
def f(self, image: torch.Tensor) -> tuple:
"""
+2 -2
View File
@@ -6,7 +6,7 @@ class PtFromLatent:
"""
Casts a latent tensor as a PyTorch tensor.
category: PyTorch wrapper
category: PyTorch wrapper - Tensor creation
"""
@classmethod
@@ -25,7 +25,7 @@ class PtFromLatent:
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "PyTorch wrapper"
CATEGORY: str = "Data Analysis"
def f(self, latent: torch.Tensor) -> tuple:
"""
+2 -2
View File
@@ -7,7 +7,7 @@ class PtFromNumpy:
"""
Converts a NumPy ndarray to a PyTorch tensor while preserving its data type.
category: PyTorch wrapper
category: PyTorch wrapper - Tensor creation
"""
@classmethod
@@ -26,7 +26,7 @@ class PtFromNumpy:
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "PyTorch wrapper"
CATEGORY: str = "Data Analysis"
def f(self, array: np.ndarray) -> Tuple[torch.Tensor]:
"""
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtGe:
"""
Tests whether elements in the first PyTorch tensor are greater than or equal to the corresponding elements in the second tensor.
category: PyTorch wrapper - Comparison operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Compares two PyTorch tensors for element-wise greater-than-or-equal-to condition.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of the same shape as `tens_a`.
Returns:
tuple: A tuple containing a boolean tensor indicating where `tens_a >= tens_b`.
"""
return (torch.ge(tens_a, tens_b),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtGt:
"""
Tests whether elements in the first PyTorch tensor are greater than the corresponding elements in the second tensor.
category: PyTorch wrapper - Comparison operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Compares two PyTorch tensors for element-wise greater-than condition.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of the same shape as `tens_a`.
Returns:
tuple: A tuple containing a boolean tensor indicating where `tens_a > tens_b`.
"""
return (torch.gt(tens_a, tens_b),)
+2 -2
View File
@@ -8,7 +8,7 @@ class PtIntCreate:
Creates a PyTorch tensor with 32-bit integer
using values entered in the text field.
category: PyTorch wrapper
category: PyTorch wrapper - Tensor creation
"""
@classmethod
@@ -27,7 +27,7 @@ class PtIntCreate:
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "PyTorch wrapper"
CATEGORY: str = "Data Analysis"
def f(self, data: str) -> tuple:
"""
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtLe:
"""
Tests whether elements in the first PyTorch tensor are less than or equal to the corresponding elements in the second tensor.
category: PyTorch wrapper - Comparison operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Compares two PyTorch tensors for element-wise less-than-or-equal-to condition.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of the same shape as `tens_a`.
Returns:
tuple: A tuple containing a boolean tensor indicating where `tens_a <= tens_b`.
"""
return (torch.le(tens_a, tens_b),)
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtLog:
"""
Computes the natural logarithm (log base e) of a PyTorch tensor element-wise.
category: PyTorch wrapper - Math operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Computes the element-wise natural logarithm (log base e) of a PyTorch tensor.
Args:
tens_a (torch.Tensor): A PyTorch tensor of numerical type. Must contain only positive values.
Returns:
tuple: A tuple containing the resultant tensor after applying the natural logarithm.
"""
return (torch.log(tens_a),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtLogicalAnd:
"""
Performs a logical AND operation on two PyTorch tensors element-wise.
category: PyTorch wrapper - Logical operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs a logical AND operation on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of boolean or numerical type.
tens_b (torch.Tensor): A PyTorch tensor of the same shape and type as `tens_a`.
Returns:
tuple: A tuple containing a boolean tensor where `tens_a AND tens_b` is applied element-wise.
"""
return (torch.logical_and(tens_a, tens_b),)
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtLogicalNot:
"""
Performs a logical NOT operation on a PyTorch tensor element-wise.
category: PyTorch wrapper - Logical operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Performs a logical NOT operation on a PyTorch tensor.
Args:
tens_a (torch.Tensor): A PyTorch tensor of boolean or numerical type.
Returns:
tuple: A tuple containing the resultant tensor after applying logical NOT.
"""
return (torch.logical_not(tens_a),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtLogicalOr:
"""
Performs a logical OR operation on two PyTorch tensors element-wise.
category: PyTorch wrapper - Logical operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs a logical OR operation on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of boolean or numerical type.
tens_b (torch.Tensor): A PyTorch tensor of the same shape and type as `tens_a`.
Returns:
tuple: A tuple containing a boolean tensor where `tens_a OR tens_b` is applied element-wise.
"""
return (torch.logical_or(tens_a, tens_b),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtLogicalXor:
"""
Performs a logical XOR operation on two PyTorch tensors element-wise.
category: PyTorch wrapper - Logical operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs a logical XOR operation on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of boolean or numerical type.
tens_b (torch.Tensor): A PyTorch tensor of the same shape and type as `tens_a`.
Returns:
tuple: A tuple containing a boolean tensor where `tens_a XOR tens_b` is applied element-wise.
"""
return (torch.logical_xor(tens_a, tens_b),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtLt:
"""
Tests whether elements in the first PyTorch tensor are less than the corresponding elements in the second tensor.
category: PyTorch wrapper - Comparison operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Compares two PyTorch tensors for element-wise less-than condition.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of the same shape as `tens_a`.
Returns:
tuple: A tuple containing a boolean tensor indicating where `tens_a < tens_b`.
"""
return (torch.lt(tens_a, tens_b),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtMatMul:
"""
Performs matrix multiplication on two PyTorch tensors.
category: PyTorch wrapper - Matrix operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs matrix multiplication on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A PyTorch tensor of shape compatible for matrix multiplication.
tens_b (torch.Tensor): A PyTorch tensor of shape that supports matrix multiplication with `tens_a`.
Returns:
tuple: A tuple containing the resultant tensor.
"""
return (torch.matmul(tens_a, tens_b),)
+44
View File
@@ -0,0 +1,44 @@
from typing import Any, Dict
import torch
class PtMm:
"""
Performs 2D matrix multiplication on two PyTorch tensors.
category: PyTorch wrapper - Matrix operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Performs 2D matrix multiplication on two PyTorch tensors.
Args:
tens_a (torch.Tensor): A 2D PyTorch tensor.
tens_b (torch.Tensor): A 2D PyTorch tensor that supports matrix multiplication with `tens_a`.
Returns:
tuple: A tuple containing the resultant tensor.
"""
if tens_a.dim() != 2 or tens_b.dim() != 2:
raise ValueError("torch.mm() only supports 2D tensors.")
return (torch.mm(tens_a, tens_b),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtMul:
"""
Multiplies two PyTorch tensors element-wise.
category: PyTorch wrapper - Arithmetic operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Multiplies two PyTorch tensors element-wise.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of shape that supports element-wise multiplication with `tens_a`.
Returns:
tuple: A tuple containing the resultant tensor.
"""
return (torch.mul(tens_a, tens_b),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtNe:
"""
Tests whether two PyTorch tensors are not equal element-wise.
category: PyTorch wrapper - Comparison operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Compares two PyTorch tensors for element-wise inequality.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of the same shape as `tens_a`.
Returns:
tuple: A tuple containing a boolean tensor indicating element-wise inequality.
"""
return (torch.ne(tens_a, tens_b),)
+39
View File
@@ -0,0 +1,39 @@
from typing import Any, Dict
import torch
class PtNeg:
"""
Computes the negation of each element in a PyTorch tensor.
category: PyTorch wrapper - Math operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor) -> tuple:
"""
Computes the negation of a PyTorch tensor element-wise.
Args:
tens_a (torch.Tensor): A PyTorch tensor of numerical type.
Returns:
tuple: A tuple containing the resultant tensor after applying negation.
"""
return (torch.neg(tens_a),)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import torch
class PtPow:
"""
Raises one PyTorch tensor to the power of another element-wise.
category: PyTorch wrapper - Arithmetic operations
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the required input types.
Returns:
Dict[str, Any]: A dictionary of required input types.
"""
return {
"required": {
"tens_a": ("TENSOR", {}),
"tens_b": ("TENSOR", {})
}
}
RETURN_TYPES: tuple = ("TENSOR",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, tens_a: torch.Tensor, tens_b: torch.Tensor) -> tuple:
"""
Raises one PyTorch tensor to the power of another element-wise.
Args:
tens_a (torch.Tensor): A PyTorch tensor of any shape.
tens_b (torch.Tensor): A PyTorch tensor of shape that supports element-wise exponentiation with `tens_a`.
Returns:
tuple: A tuple containing the resultant tensor.
"""
return (torch.pow(tens_a, tens_b),)

Some files were not shown because too many files have changed in this diff Show More