use .shape instead of .size() for consistency

This commit is contained in:
rasbt 2024-02-25 08:47:25 -06:00
parent cdcd73ba7f
commit 3f186ab072

View File

@ -756,7 +756,7 @@
" # Compute the output of the current layer\n",
" layer_output = layer(x)\n",
" # Check if shortcut can be applied\n",
" if self.use_shortcut and x.size() == layer_output.size():\n",
" if self.use_shortcut and x.shape == layer_output.shape:\n",
" x = x + layer_output\n",
" else:\n",
" x = layer_output\n",