From 6127d8094471345ae874ff2014f59a1d1e83612e Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Tue, 20 Oct 2026 03:39:04 -0700 Subject: [PATCH] Suppress new Pyrefly findings before upgrading to v1.4.0 PiperOrigin-RevId: 1002979928 --- sonnet/src/initializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonnet/src/initializers.py b/sonnet/src/initializers.py index e4cf366..9aa91bc 100644 --- a/sonnet/src/initializers.py +++ b/sonnet/src/initializers.py @@ -177,7 +177,7 @@ def __init__(self, gain: float = 1.0): def __call__(self, shape: types.ShapeLike, dtype: tf.DType) -> tf.Tensor: dtype = _as_numerical_dtype(dtype) - rank = shape.shape[0] if isinstance(shape, tf.Tensor) else len(shape) + rank = shape.shape[0] if isinstance(shape, tf.Tensor) else len(shape) # pyrefly: ignore[bad-argument-type] if rank < 2: raise ValueError("The tensor to initialize must be " "at least two-dimensional")