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
Could generics be implemented for the specific size of a dimension? or perhaps even generics for multiple dimensions at once?
An example of where this may be useful is in a covariance matrix function:
def var_covar(data: NDArray[T, Any], mean: NDArray[T]) -> NDArray[T, T]:
'''calculate variance-covariance matrix with prior mean'''
diff = X - mean
return (diff.T @ diff) / X.shape[0] # X.shape[0] will always have the same value as T
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Could generics be implemented for the specific size of a dimension? or perhaps even generics for multiple dimensions at once?
An example of where this may be useful is in a covariance matrix function:
Beta Was this translation helpful? Give feedback.
All reactions