code: def test_ill_shape(self):
      loss = BendingEnergyLoss()
      # not in 3-d, 4-d, 5-d
      with self.assertRaisesRegex(
          ValueError, "Expecting 3-d, 4-d or 5-d"
      ):
          loss.forward(torch.ones((1, 3), device=device))
      with self.assertRaisesRegex(
          ValueError, "Expecting 3-d, 4-d or 5-d"
      ):
          loss.forward(torch.ones((1, 4, 5, 5, 5, 5), device=device))
      with self.assertRaisesRegex(ValueError, "All spatial dimensions"):
          loss.forward(torch.ones((1, 3, 4, 5, 5), device=device))
      with self.assertRaisesRegex(ValueError, "All spatial dimensions"):
          loss.forward(torch.ones((1, 3, 5, 4, 5)))
      with self.assertRaisesRegex(ValueError, "All spatial dimensions"):
          loss.forward(torch.ones((1, 3, 5, 5, 4)))
  
      # number of vector components unequal to number of spatial dims
      with self.assertRaisesRegex(
          ValueError, "Number of vector components"
      ):
          loss.forward(torch.ones((1, 2, 5, 5, 5)))
      with self.assertRaisesRegex(
          ValueError, "Number of vector components"
      ):
          loss.forward(torch.ones((1, 2, 5, 5, 5)))
  
file_path: MONAI/tests/test_bending_energy.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.losses.deform import BendingEnergyLoss
label_desc: Use image node_id 2 for calling the TestBendingEnergy obj's underlying member method code with example usage: obj.test_ill_shape() without return types