From 56e55994237703ca878c4f83280ce987041f4b65 Mon Sep 17 00:00:00 2001 From: HowToSD Date: Fri, 14 Mar 2025 19:36:21 -0700 Subject: [PATCH] Updated docstrings for activation functions and data type conversion functions. --- docs/reference/node_reference.md | 36 +++++++++---------- docs/reference/pt_to_bfloat16.md | 2 +- docs/reference/pt_to_float16.md | 2 +- docs/reference/pt_to_float32.md | 2 +- docs/reference/pt_to_float64.md | 2 +- docs/reference/pt_to_int16.md | 2 +- docs/reference/pt_to_int32.md | 2 +- docs/reference/pt_to_int64.md | 2 +- docs/reference/pt_to_int8.md | 2 +- docs/reference/pt_to_uint8.md | 2 +- docs/reference/ptf_gelu.md | 2 +- docs/reference/ptf_leaky_relu.md | 2 +- docs/reference/ptf_log_softmax.md | 2 +- docs/reference/ptf_relu.md | 2 +- docs/reference/ptf_sigmoid.md | 2 +- docs/reference/ptf_silu.md | 2 +- docs/reference/ptf_softmax.md | 2 +- docs/reference/ptf_softplus.md | 2 +- docs/reference/ptf_tanh.md | 2 +- docs/reference/ptn_resnet_model_def.md | 7 ---- modules/pytorch_wrapper/pt_to_bfloat16.py | 1 + modules/pytorch_wrapper/pt_to_float16.py | 1 + modules/pytorch_wrapper/pt_to_float32.py | 1 + modules/pytorch_wrapper/pt_to_float64.py | 1 + modules/pytorch_wrapper/pt_to_int16.py | 1 + modules/pytorch_wrapper/pt_to_int32.py | 1 + modules/pytorch_wrapper/pt_to_int64.py | 1 + modules/pytorch_wrapper/pt_to_int8.py | 1 + modules/pytorch_wrapper/pt_to_uint8.py | 1 + modules/pytorch_wrapper/ptf_gelu.py | 3 +- modules/pytorch_wrapper/ptf_leaky_relu.py | 3 +- modules/pytorch_wrapper/ptf_log_softmax.py | 2 +- modules/pytorch_wrapper/ptf_relu.py | 3 +- modules/pytorch_wrapper/ptf_sigmoid.py | 2 +- modules/pytorch_wrapper/ptf_silu.py | 3 +- modules/pytorch_wrapper/ptf_softmax.py | 2 +- modules/pytorch_wrapper/ptf_softplus.py | 3 +- modules/pytorch_wrapper/ptf_tanh.py | 2 +- .../{pt_to_uint8.py => pt_to_uint8_test.py} | 0 39 files changed, 54 insertions(+), 57 deletions(-) delete mode 100644 docs/reference/ptn_resnet_model_def.md rename tests/pytorch_wrapper/{pt_to_uint8.py => pt_to_uint8_test.py} (100%) diff --git a/docs/reference/node_reference.md b/docs/reference/node_reference.md index 2296e86..3ddd10c 100644 --- a/docs/reference/node_reference.md +++ b/docs/reference/node_reference.md @@ -30,15 +30,15 @@ ## PyTorch wrapper - Callable | Node | Description | | --- | --- | -| [Ptf GELU](ptf_gelu.md) | | -| [Ptf LeakyReLU](ptf_leaky_relu.md) | | -| [Ptf Log Softmax](ptf_log_softmax.md) | A PyTorch wrapper for the log_softmax activation function. | -| [Ptf ReLU](ptf_relu.md) | | -| [Ptf SiLU](ptf_silu.md) | | -| [Ptf Sigmoid](ptf_sigmoid.md) | A PyTorch wrapper for the sigmoid activation function. | -| [Ptf Softmax](ptf_softmax.md) | A PyTorch wrapper for the softmax activation function. | -| [Ptf Softplus](ptf_softplus.md) | | -| [Ptf Tanh](ptf_tanh.md) | A PyTorch wrapper for the tanh activation function. | +| [Ptf GELU](ptf_gelu.md) | The GELU activation function. | +| [Ptf LeakyReLU](ptf_leaky_relu.md) | The LeakyReLU activation function. | +| [Ptf Log Softmax](ptf_log_softmax.md) | The log softmax activation function. | +| [Ptf ReLU](ptf_relu.md) | The ReLU activation function. | +| [Ptf SiLU](ptf_silu.md) | The SiLU activation function. | +| [Ptf Sigmoid](ptf_sigmoid.md) | The sigmoid activation function. | +| [Ptf Softmax](ptf_softmax.md) | The softmax activation function. | +| [Ptf Softplus](ptf_softplus.md) | The Softplus activation function. | +| [Ptf Tanh](ptf_tanh.md) | The tanh activation function. | ## PyTorch wrapper - Comparison operations | Node | Description | | --- | --- | @@ -51,15 +51,15 @@ ## PyTorch wrapper - Data type conversion | Node | Description | | --- | --- | -| [Pt To Bfloat](pt_to_bfloat16.md) | Converts the input tensor's data type to bfloat16. | -| [Pt To Float](pt_to_float16.md) | Converts the input tensor's data type to float16. | -| [Pt To Float](pt_to_float32.md) | Converts the input tensor's data type to float32. | -| [Pt To Float](pt_to_float64.md) | Converts the input tensor's data type to float64. | -| [Pt To Int](pt_to_int16.md) | Converts the input tensor's data type to int16. | -| [Pt To Int](pt_to_int32.md) | Converts the input tensor's data type to int32. | -| [Pt To Int](pt_to_int64.md) | Converts the input tensor's data type to int64. | -| [Pt To Int](pt_to_int8.md) | Converts the input tensor's data type to int8. | -| [Pt To Uint](pt_to_uint8.md) | Converts the input tensor's data type to uint8. | +| [Pt To Bfloat16](pt_to_bfloat16.md) | Converts the input tensor's data type to bfloat16. | +| [Pt To Float16](pt_to_float16.md) | Converts the input tensor's data type to float16. | +| [Pt To Float32](pt_to_float32.md) | Converts the input tensor's data type to float32. | +| [Pt To Float64](pt_to_float64.md) | Converts the input tensor's data type to float64. | +| [Pt To Int16](pt_to_int16.md) | Converts the input tensor's data type to int16. | +| [Pt To Int32](pt_to_int32.md) | Converts the input tensor's data type to int32. | +| [Pt To Int64](pt_to_int64.md) | Converts the input tensor's data type to int64. | +| [Pt To Int8](pt_to_int8.md) | Converts the input tensor's data type to int8. | +| [Pt To Uint8](pt_to_uint8.md) | Converts the input tensor's data type to uint8. | ## PyTorch wrapper - Image processing | Node | Description | | --- | --- | diff --git a/docs/reference/pt_to_bfloat16.md b/docs/reference/pt_to_bfloat16.md index 31ff163..8734770 100644 --- a/docs/reference/pt_to_bfloat16.md +++ b/docs/reference/pt_to_bfloat16.md @@ -1,4 +1,4 @@ -# Pt To Bfloat +# Pt To Bfloat16 Converts the input tensor's data type to bfloat16. ## Input diff --git a/docs/reference/pt_to_float16.md b/docs/reference/pt_to_float16.md index 2a18a20..49218b7 100644 --- a/docs/reference/pt_to_float16.md +++ b/docs/reference/pt_to_float16.md @@ -1,4 +1,4 @@ -# Pt To Float +# Pt To Float16 Converts the input tensor's data type to float16. ## Input diff --git a/docs/reference/pt_to_float32.md b/docs/reference/pt_to_float32.md index fdf9f64..90d285d 100644 --- a/docs/reference/pt_to_float32.md +++ b/docs/reference/pt_to_float32.md @@ -1,4 +1,4 @@ -# Pt To Float +# Pt To Float32 Converts the input tensor's data type to float32. ## Input diff --git a/docs/reference/pt_to_float64.md b/docs/reference/pt_to_float64.md index 15ebfe5..0bbc8ab 100644 --- a/docs/reference/pt_to_float64.md +++ b/docs/reference/pt_to_float64.md @@ -1,4 +1,4 @@ -# Pt To Float +# Pt To Float64 Converts the input tensor's data type to float64. ## Input diff --git a/docs/reference/pt_to_int16.md b/docs/reference/pt_to_int16.md index 54ded7b..20f0383 100644 --- a/docs/reference/pt_to_int16.md +++ b/docs/reference/pt_to_int16.md @@ -1,4 +1,4 @@ -# Pt To Int +# Pt To Int16 Converts the input tensor's data type to int16. ## Input diff --git a/docs/reference/pt_to_int32.md b/docs/reference/pt_to_int32.md index 4eb5db7..5a4976f 100644 --- a/docs/reference/pt_to_int32.md +++ b/docs/reference/pt_to_int32.md @@ -1,4 +1,4 @@ -# Pt To Int +# Pt To Int32 Converts the input tensor's data type to int32. ## Input diff --git a/docs/reference/pt_to_int64.md b/docs/reference/pt_to_int64.md index b7ed77d..38702de 100644 --- a/docs/reference/pt_to_int64.md +++ b/docs/reference/pt_to_int64.md @@ -1,4 +1,4 @@ -# Pt To Int +# Pt To Int64 Converts the input tensor's data type to int64. ## Input diff --git a/docs/reference/pt_to_int8.md b/docs/reference/pt_to_int8.md index 71d712f..27d21a0 100644 --- a/docs/reference/pt_to_int8.md +++ b/docs/reference/pt_to_int8.md @@ -1,4 +1,4 @@ -# Pt To Int +# Pt To Int8 Converts the input tensor's data type to int8. ## Input diff --git a/docs/reference/pt_to_uint8.md b/docs/reference/pt_to_uint8.md index 9395a63..4c466d0 100644 --- a/docs/reference/pt_to_uint8.md +++ b/docs/reference/pt_to_uint8.md @@ -1,4 +1,4 @@ -# Pt To Uint +# Pt To Uint8 Converts the input tensor's data type to uint8. ## Input diff --git a/docs/reference/ptf_gelu.md b/docs/reference/ptf_gelu.md index 72b8e39..cdcccee 100644 --- a/docs/reference/ptf_gelu.md +++ b/docs/reference/ptf_gelu.md @@ -1,5 +1,5 @@ # Ptf GELU -A PyTorch wrapper for the GELU activation function. +The GELU activation function. This class provides a callable that applies the GELU activation function from `torch.nn.functional`. diff --git a/docs/reference/ptf_leaky_relu.md b/docs/reference/ptf_leaky_relu.md index d33c7f7..169fb7d 100644 --- a/docs/reference/ptf_leaky_relu.md +++ b/docs/reference/ptf_leaky_relu.md @@ -1,5 +1,5 @@ # Ptf LeakyReLU -A PyTorch wrapper for the LeakyReLU activation function. +The LeakyReLU activation function. This class provides a callable that applies the LeakyReLU activation function from `torch.nn.functional`. diff --git a/docs/reference/ptf_log_softmax.md b/docs/reference/ptf_log_softmax.md index 8f5fa6c..b6ee593 100644 --- a/docs/reference/ptf_log_softmax.md +++ b/docs/reference/ptf_log_softmax.md @@ -1,5 +1,5 @@ # Ptf Log Softmax -A PyTorch wrapper for the log_softmax activation function. +The log softmax activation function. This class provides a callable that applies the log_softmax activation function from `torch.nn.functional`. diff --git a/docs/reference/ptf_relu.md b/docs/reference/ptf_relu.md index b5886b9..79fc1d1 100644 --- a/docs/reference/ptf_relu.md +++ b/docs/reference/ptf_relu.md @@ -1,5 +1,5 @@ # Ptf ReLU -A PyTorch wrapper for the ReLU activation function. +The ReLU activation function. This class provides a callable that applies the ReLU activation function from `torch.nn.functional`. diff --git a/docs/reference/ptf_sigmoid.md b/docs/reference/ptf_sigmoid.md index c9de591..41dd985 100644 --- a/docs/reference/ptf_sigmoid.md +++ b/docs/reference/ptf_sigmoid.md @@ -1,5 +1,5 @@ # Ptf Sigmoid -A PyTorch wrapper for the sigmoid activation function. +The sigmoid activation function. This class provides a callable that applies the sigmoid activation function from `torch.nn.functional`. diff --git a/docs/reference/ptf_silu.md b/docs/reference/ptf_silu.md index e3e9343..81b4265 100644 --- a/docs/reference/ptf_silu.md +++ b/docs/reference/ptf_silu.md @@ -1,5 +1,5 @@ # Ptf SiLU -A PyTorch wrapper for the SiLU activation function. +The SiLU activation function. This class provides a callable that applies the SiLU activation function from `torch.nn.functional`. diff --git a/docs/reference/ptf_softmax.md b/docs/reference/ptf_softmax.md index 6d651c5..02c3ad7 100644 --- a/docs/reference/ptf_softmax.md +++ b/docs/reference/ptf_softmax.md @@ -1,5 +1,5 @@ # Ptf Softmax -A PyTorch wrapper for the softmax activation function. +The softmax activation function. This class provides a callable that applies the softmax activation function from `torch.nn.functional`. diff --git a/docs/reference/ptf_softplus.md b/docs/reference/ptf_softplus.md index b2d00ab..86003df 100644 --- a/docs/reference/ptf_softplus.md +++ b/docs/reference/ptf_softplus.md @@ -1,5 +1,5 @@ # Ptf Softplus -A PyTorch wrapper for the Softplus activation function. +The Softplus activation function. This class provides a callable that applies the Softplus activation function from `torch.nn.functional`. diff --git a/docs/reference/ptf_tanh.md b/docs/reference/ptf_tanh.md index def3af3..f5ec146 100644 --- a/docs/reference/ptf_tanh.md +++ b/docs/reference/ptf_tanh.md @@ -1,5 +1,5 @@ # Ptf Tanh -A PyTorch wrapper for the tanh activation function. +The tanh activation function. This class provides a callable that applies the tanh activation function from `torch.nn.functional`. diff --git a/docs/reference/ptn_resnet_model_def.md b/docs/reference/ptn_resnet_model_def.md deleted file mode 100644 index 588c8e2..0000000 --- a/docs/reference/ptn_resnet_model_def.md +++ /dev/null @@ -1,7 +0,0 @@ -# Resnet Model - - -
-Category: Miscellaneous - -ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. diff --git a/modules/pytorch_wrapper/pt_to_bfloat16.py b/modules/pytorch_wrapper/pt_to_bfloat16.py index 4a97cc1..2112c6e 100644 --- a/modules/pytorch_wrapper/pt_to_bfloat16.py +++ b/modules/pytorch_wrapper/pt_to_bfloat16.py @@ -3,6 +3,7 @@ import torch class PtToBfloat16: """ + Pt To Bfloat16: Converts the input tensor's data type to bfloat16. category: PyTorch wrapper - Data type conversion diff --git a/modules/pytorch_wrapper/pt_to_float16.py b/modules/pytorch_wrapper/pt_to_float16.py index f062651..59e3c56 100644 --- a/modules/pytorch_wrapper/pt_to_float16.py +++ b/modules/pytorch_wrapper/pt_to_float16.py @@ -3,6 +3,7 @@ import torch class PtToFloat16: """ + Pt To Float16: Converts the input tensor's data type to float16. category: PyTorch wrapper - Data type conversion diff --git a/modules/pytorch_wrapper/pt_to_float32.py b/modules/pytorch_wrapper/pt_to_float32.py index f26ecc0..1cfd3a8 100644 --- a/modules/pytorch_wrapper/pt_to_float32.py +++ b/modules/pytorch_wrapper/pt_to_float32.py @@ -3,6 +3,7 @@ import torch class PtToFloat32: """ + Pt To Float32: Converts the input tensor's data type to float32. category: PyTorch wrapper - Data type conversion diff --git a/modules/pytorch_wrapper/pt_to_float64.py b/modules/pytorch_wrapper/pt_to_float64.py index 8a906fa..f4dd6ff 100644 --- a/modules/pytorch_wrapper/pt_to_float64.py +++ b/modules/pytorch_wrapper/pt_to_float64.py @@ -3,6 +3,7 @@ import torch class PtToFloat64: """ + Pt To Float64: Converts the input tensor's data type to float64. category: PyTorch wrapper - Data type conversion diff --git a/modules/pytorch_wrapper/pt_to_int16.py b/modules/pytorch_wrapper/pt_to_int16.py index 440a0b3..1044d36 100644 --- a/modules/pytorch_wrapper/pt_to_int16.py +++ b/modules/pytorch_wrapper/pt_to_int16.py @@ -3,6 +3,7 @@ import torch class PtToInt16: """ + Pt To Int16: Converts the input tensor's data type to int16. category: PyTorch wrapper - Data type conversion diff --git a/modules/pytorch_wrapper/pt_to_int32.py b/modules/pytorch_wrapper/pt_to_int32.py index ec75884..c270870 100644 --- a/modules/pytorch_wrapper/pt_to_int32.py +++ b/modules/pytorch_wrapper/pt_to_int32.py @@ -3,6 +3,7 @@ import torch class PtToInt32: """ + Pt To Int32: Converts the input tensor's data type to int32. category: PyTorch wrapper - Data type conversion diff --git a/modules/pytorch_wrapper/pt_to_int64.py b/modules/pytorch_wrapper/pt_to_int64.py index 31dcdb3..9d690dd 100644 --- a/modules/pytorch_wrapper/pt_to_int64.py +++ b/modules/pytorch_wrapper/pt_to_int64.py @@ -3,6 +3,7 @@ import torch class PtToInt64: """ + Pt To Int64: Converts the input tensor's data type to int64. category: PyTorch wrapper - Data type conversion diff --git a/modules/pytorch_wrapper/pt_to_int8.py b/modules/pytorch_wrapper/pt_to_int8.py index 4bccaab..957c511 100644 --- a/modules/pytorch_wrapper/pt_to_int8.py +++ b/modules/pytorch_wrapper/pt_to_int8.py @@ -3,6 +3,7 @@ import torch class PtToInt8: """ + Pt To Int8: Converts the input tensor's data type to int8. category: PyTorch wrapper - Data type conversion diff --git a/modules/pytorch_wrapper/pt_to_uint8.py b/modules/pytorch_wrapper/pt_to_uint8.py index e9a7b25..912535b 100644 --- a/modules/pytorch_wrapper/pt_to_uint8.py +++ b/modules/pytorch_wrapper/pt_to_uint8.py @@ -3,6 +3,7 @@ import torch class PtToUint8: """ + Pt To Uint8: Converts the input tensor's data type to uint8. category: PyTorch wrapper - Data type conversion diff --git a/modules/pytorch_wrapper/ptf_gelu.py b/modules/pytorch_wrapper/ptf_gelu.py index 5eafef3..28c2650 100644 --- a/modules/pytorch_wrapper/ptf_gelu.py +++ b/modules/pytorch_wrapper/ptf_gelu.py @@ -5,8 +5,7 @@ import torch.nn.functional class PtfGELU: """ Ptf GELU: - - A PyTorch wrapper for the GELU activation function. + The GELU activation function. This class provides a callable that applies the GELU activation function from `torch.nn.functional`. diff --git a/modules/pytorch_wrapper/ptf_leaky_relu.py b/modules/pytorch_wrapper/ptf_leaky_relu.py index 8197c9f..8c73213 100644 --- a/modules/pytorch_wrapper/ptf_leaky_relu.py +++ b/modules/pytorch_wrapper/ptf_leaky_relu.py @@ -6,8 +6,7 @@ import functools class PtfLeakyReLU: """ Ptf LeakyReLU: - - A PyTorch wrapper for the LeakyReLU activation function. + The LeakyReLU activation function. This class provides a callable that applies the LeakyReLU activation function from `torch.nn.functional`. diff --git a/modules/pytorch_wrapper/ptf_log_softmax.py b/modules/pytorch_wrapper/ptf_log_softmax.py index 678f31d..c6031f3 100644 --- a/modules/pytorch_wrapper/ptf_log_softmax.py +++ b/modules/pytorch_wrapper/ptf_log_softmax.py @@ -7,7 +7,7 @@ log_softmax_last_axis = functools.partial(torch.nn.functional.log_softmax, dim=- class PtfLogSoftmax: """ - A PyTorch wrapper for the log_softmax activation function. + The log softmax activation function. This class provides a callable that applies the log_softmax activation function from `torch.nn.functional`. diff --git a/modules/pytorch_wrapper/ptf_relu.py b/modules/pytorch_wrapper/ptf_relu.py index cda7930..1908c5c 100644 --- a/modules/pytorch_wrapper/ptf_relu.py +++ b/modules/pytorch_wrapper/ptf_relu.py @@ -5,8 +5,7 @@ import torch.nn.functional class PtfReLU: """ Ptf ReLU: - - A PyTorch wrapper for the ReLU activation function. + The ReLU activation function. This class provides a callable that applies the ReLU activation function from `torch.nn.functional`. diff --git a/modules/pytorch_wrapper/ptf_sigmoid.py b/modules/pytorch_wrapper/ptf_sigmoid.py index 6076475..dbbcb48 100644 --- a/modules/pytorch_wrapper/ptf_sigmoid.py +++ b/modules/pytorch_wrapper/ptf_sigmoid.py @@ -4,7 +4,7 @@ import torch.nn.functional class PtfSigmoid: """ - A PyTorch wrapper for the sigmoid activation function. + The sigmoid activation function. This class provides a callable that applies the sigmoid activation function from `torch.nn.functional`. diff --git a/modules/pytorch_wrapper/ptf_silu.py b/modules/pytorch_wrapper/ptf_silu.py index e13f8da..68455a6 100644 --- a/modules/pytorch_wrapper/ptf_silu.py +++ b/modules/pytorch_wrapper/ptf_silu.py @@ -5,8 +5,7 @@ import torch.nn.functional class PtfSiLU: """ Ptf SiLU: - - A PyTorch wrapper for the SiLU activation function. + The SiLU activation function. This class provides a callable that applies the SiLU activation function from `torch.nn.functional`. diff --git a/modules/pytorch_wrapper/ptf_softmax.py b/modules/pytorch_wrapper/ptf_softmax.py index c20cd9e..cb94dfc 100644 --- a/modules/pytorch_wrapper/ptf_softmax.py +++ b/modules/pytorch_wrapper/ptf_softmax.py @@ -6,7 +6,7 @@ softmax_last_axis = functools.partial(torch.nn.functional.softmax, dim=-1) class PtfSoftmax: """ - A PyTorch wrapper for the softmax activation function. + The softmax activation function. This class provides a callable that applies the softmax activation function from `torch.nn.functional`. diff --git a/modules/pytorch_wrapper/ptf_softplus.py b/modules/pytorch_wrapper/ptf_softplus.py index 2b16f05..681c622 100644 --- a/modules/pytorch_wrapper/ptf_softplus.py +++ b/modules/pytorch_wrapper/ptf_softplus.py @@ -5,8 +5,7 @@ import torch.nn.functional class PtfSoftplus: """ Ptf Softplus: - - A PyTorch wrapper for the Softplus activation function. + The Softplus activation function. This class provides a callable that applies the Softplus activation function from `torch.nn.functional`. diff --git a/modules/pytorch_wrapper/ptf_tanh.py b/modules/pytorch_wrapper/ptf_tanh.py index b4d6ca5..40c73e3 100644 --- a/modules/pytorch_wrapper/ptf_tanh.py +++ b/modules/pytorch_wrapper/ptf_tanh.py @@ -4,7 +4,7 @@ import torch.nn.functional class PtfTanh: """ - A PyTorch wrapper for the tanh activation function. + The tanh activation function. This class provides a callable that applies the tanh activation function from `torch.nn.functional`. diff --git a/tests/pytorch_wrapper/pt_to_uint8.py b/tests/pytorch_wrapper/pt_to_uint8_test.py similarity index 100% rename from tests/pytorch_wrapper/pt_to_uint8.py rename to tests/pytorch_wrapper/pt_to_uint8_test.py