From 45af0df90bc7e84ed6244331db7d3d20f0d40b5d Mon Sep 17 00:00:00 2001 From: Angelos Katharopoulos Date: Wed, 18 Mar 2026 22:47:38 -0700 Subject: [PATCH] Fix repr of conv layers (#3275) --- python/mlx/nn/layers/convolution.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/mlx/nn/layers/convolution.py b/python/mlx/nn/layers/convolution.py index 88b97add..2109e84f 100644 --- a/python/mlx/nn/layers/convolution.py +++ b/python/mlx/nn/layers/convolution.py @@ -66,7 +66,7 @@ class Conv1d(Module): def _extra_repr(self): return ( - f"{self.weight.shape[-1]}, {self.weight.shape[0]}, " + f"{self.weight.shape[-1] * self.groups}, {self.weight.shape[0]}, " f"kernel_size={self.weight.shape[1]}, stride={self.stride}, " f"padding={self.padding}, dilation={self.dilation}, " f"groups={self.groups}, " @@ -146,7 +146,7 @@ class Conv2d(Module): def _extra_repr(self): return ( - f"{self.weight.shape[-1]}, {self.weight.shape[0]}, " + f"{self.weight.shape[-1] * self.groups}, {self.weight.shape[0]}, " f"kernel_size={self.weight.shape[1:3]}, stride={self.stride}, " f"padding={self.padding}, dilation={self.dilation}, " f"groups={self.groups}, " @@ -219,7 +219,7 @@ class Conv3d(Module): def _extra_repr(self): return ( - f"{self.weight.shape[-1]}, {self.weight.shape[0]}, " + f"{self.weight.shape[-1] * self.groups}, {self.weight.shape[0]}, " f"kernel_size={self.weight.shape[1:4]}, stride={self.stride}, " f"padding={self.padding}, dilation={self.dilation}, " f"bias={'bias' in self}"