Maintain consistent naming conventions throughout the codebase to enhance readability and reduce confusion. This applies to: 1. **Import aliases**: Use standardized aliases for imported libraries. When working with both MXNet's NumPy and the official NumPy, use 'onp' for the official NumPy to clearly distinguish between them:
Maintain consistent naming conventions throughout the codebase to enhance readability and reduce confusion. This applies to:
import numpy as onp # Official NumPy
from mxnet import np # MXNet NumPy
# Good
def matrix_transpose(x: ndarray, /) -> ndarray:
# implementation
# Avoid
def matrix_transpose(self: ndarray, /) -> ndarray:
# implementation
# Good
for key, value in data_shape.items():
# implementation
# Avoid
for obj in data_shape:
# implementation
Type annotations: Maintain a consistent style for type annotations throughout the codebase, with explicit type names for parameters and return values.
Enter the URL of a public GitHub repository