You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: RULES.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,15 +76,15 @@ Some are applicable for different technologies.
76
76
| GCI97 | Optimize square computation (scalar vs vectorized method) | In Python, if you want to square x, you can do x*x or x**2. || ❓ | ❓ | ❓ | ✅ | ❓ | ❓ | ❓ |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI97)|
77
77
| GCI98 | Avoid raising Runtime Exceptions when a check is possible | You should not catch RuntimeException. They produce large objects and represent a problem in the program that should be fixed, not handled. |[Unchecked Exceptions The Controversy](https://docs.oracle.com/javase/tutorial/essential/exceptions/runtime.html) (9.3. Les classes Exception, RunTimeException et Error)[https://www.jmdoudoux.fr/java/dej/chap-exceptions.htm#exceptions-3]| 🚧 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI98)|
78
78
| GCI99 | Data : Avoid CSV Format | The Parquet format is faster to write to, lighter in weight and faster to read data from. It is suitable for use cases where there would be a lot of data I/O, especially with Cloud storage. || 🚀 | 🚀 | 🚀 | ✅ | 🚀 | 🚀 | 🚀 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI99)|
79
-
| GCI100 | AI : Wrap PyTorch Inference in `torch.no_grad()`| Using a PyTorch model in evaluation mode without wrapping inference in `torch.no_grad()` leads to unnecessary gradient tracking || 🚫 | 🚫 | 🚫 |🚧| 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI100)|
80
-
| GCI101 | AI : Avoid Bias in Conv Layers Before Batch Norm | Disable bias in convolutional layers when it's followed by a batch norm layer || 🚫 | 🚫 | 🚫 |🚧| 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI101)|
81
-
| GCI102 | AI : Use pinned memory on DataLoader when using GPU | This rule applies to PyTorch data loading, where the use of pinned memory can significantly optimize data transfer between CPU and GPU. || 🚫 | 🚫 | 🚫 |🚧| 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI102)|
79
+
| GCI100 | AI : Wrap PyTorch Inference in `torch.no_grad()`| Using a PyTorch model in evaluation mode without wrapping inference in `torch.no_grad()` leads to unnecessary gradient tracking || 🚫 | 🚫 | 🚫 |✅ | 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI100)|
80
+
| GCI101 | AI : Avoid Bias in Conv Layers Before Batch Norm | Disable bias in convolutional layers when it's followed by a batch norm layer || 🚫 | 🚫 | 🚫 |✅ | 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI101)|
81
+
| GCI102 | AI : Use pinned memory on DataLoader when using GPU | This rule applies to PyTorch data loading, where the use of pinned memory can significantly optimize data transfer between CPU and GPU. || 🚫 | 🚫 | 🚫 |✅ | 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI102)|
82
82
| GCI103 | Don't use .items() to iterate over a dictionary when only keys or values are needed | Avoid using `.items()` if you only use the key or the value, as this creates an unnecessary tuple, leading to increased memory allocation and slower execution. || ❓ | ❓ | ❓ | ✅ | ❓ | ❓ | ❓ |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI103)|
83
-
| GCI104 | Data / AI : PyTorch - Create tensors directly from Torch | In PyTorch, prefer creating tensors directly using `torch.rand`, `torch.tensor`, or other Torch methods instead of converting from NumPy arrays. Avoid using `torch.tensor(np.random.rand(...))` or similar patterns when the same result can be achieved directly with PyTorch. || 🚫 | 🚫 | 🚫 |🚀| 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI104)|
| GCI104 | Data / AI : PyTorch - Create tensors directly from Torch | In PyTorch, prefer creating tensors directly using `torch.rand`, `torch.tensor`, or other Torch methods instead of converting from NumPy arrays. Avoid using `torch.tensor(np.random.rand(...))` or similar patterns when the same result can be achieved directly with PyTorch. || 🚫 | 🚫 | 🚫 |✅ | 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI104)|
| GCI106 | Avoid Square Root Operations In Loop | Using scalar `math.sqrt` (or `numpy.sqrt` on individual values) inside loops leads to inefficient code || 🚫 | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI106)|
86
86
| GCI107 | Data : Avoid Iterative Matrix Operations | Use vectorization by the usage of the built-in functions of TensorFlow, NumPy or Pandas || 🚫 | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI107)|
87
-
| GCI108 | Prefer Append Left | When you want to insert an element at the beginning of a list, it's better to use a deques or a double linkedlist. || ❓ | ❓ | ❓ |🚀| ❓ | ❓ | ❓ |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI108)|
87
+
| GCI108 | Prefer Append Left | When you want to insert an element at the beginning of a list, it's better to use a deques or a double linkedlist. || ❓ | ❓ | ❓ |✅ | ❓ | ❓ | ❓ |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI108)|
88
88
| GCI203 | Detect unoptimized file formats | When it is possible, to use svg format image over other image format || 🚧 | 🚀 | 🚀 | ✅ | 🚀 | 🚀 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI203)|
89
89
| GCI404 | Avoid list comprehension in iterations | Use generator comprehension instead of list comprehension in for loop declaration || 🚫 | 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI404)|
90
90
| GCI522 | Sobriety: Brightness Override | To avoid draining the battery, iOS and Android devices adapt the brightness of the screen depending on the environment light. || 🚫 | 🚫 | ✅ | 🚫 | 🚫 | 🚫 | 🚫 |[documentation](https://github.com/green-code-initiative/creedengo-rules-specifications/tree/main/src/main/rules/GCI522)|
0 commit comments