code: def test_while_net(self):
      with NetBuilder() as nb:
          x = ops.Const(0)
          y = ops.Const(0)
          with ops.WhileNet():
              with ops.Condition():
                  ops.Add([x, ops.Const(1)], [x])
                  ops.LT([x, ops.Const(7)])
              ops.Add([x, y], [y])
  
      plan = Plan("while_net_test")
      plan.AddStep(to_execution_step(nb))
      ws = workspace.C.Workspace()
      ws.run(plan)
  
      x_value = ws.blobs[str(x)].fetch()
      y_value = ws.blobs[str(y)].fetch()
  
      self.assertEqual(x_value, 7)
      self.assertEqual(y_value, 21)
  
imports: from caffe2.python import workspace
  from caffe2.python.core import Plan, to_execution_step, Net
  from caffe2.python.task import Task, TaskGroup, final_output
  from caffe2.python.net_builder import ops, NetBuilder
  from caffe2.python.session import LocalSession
  import unittest
  import threading
label_desc: Use image node_id 10 for calling the TestNetBuilder obj's underlying member method code with example usage: obj.test_while_net() without return types