class_docstr: Tests for utilities in nn_ops.py.
class_docstr_tok: ["Tests","for","utilities","in","nn_ops.py","."]
docstr: Tests extract_patches.
docstr_tok: ["Tests","extract_patches","."]
code: def test_extract_patches(self):
      """Tests extract_patches."""
      input_shape = (16, 3, 3, 32)
      inputs = np.array(np.random.normal(size=input_shape))
  
      # patching a 3x3 image to 3x3 patches, with no stride 1x1 should do nothing
      # but reshaping the (bs, h, w, c) to (bs, 1, 1, h, w, c)
      patched = nn_ops.extract_patches(inputs, (3, 3), (1, 1))
      self.assertEqual(patched.shape, (16, 1, 1, 3, 3, 32))
      np.testing.assert_allclose(
          inputs, patched.reshape(input_shape), atol=1e-2
      )
  
imports: import functools
  from absl.testing import absltest
  from absl.testing import parameterized
  import flax.linen
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib.layers import nn_ops
label_desc: Use image node_id 7 for calling the NNOpsTest obj's underlying member method code with example usage: obj.test_extract_patches() without return types