From fa4122ee005d8a1ea4005a7d8880736a39de929f Mon Sep 17 00:00:00 2001 From: RoachZhao Date: Wed, 14 Aug 2024 16:34:51 +0800 Subject: [PATCH] Fix numpy TypeError. Get `TypeError: 'tuple' object cannot be interpreted as an integer` when run `np.random.randn((3,3))`. Numpy version: `1.26.4`. --- docs/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.rst b/docs/README.rst index e16d4ba..c9b77e3 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -46,7 +46,7 @@ Example @batching(max_batch_size=32) class MyModel: def __init__(self, k, n): - self.weights = np.random.randn((k, n)).astype("f") + self.weights = np.random.randn(k, n).astype("f") # x: [batch_size, m, k], self.weights: [k, n] def predict_batch(self, x):