MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / test_clear

Method test_clear

test/sot/test_mutable_data.py:300–304  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

298 self.assertEqual(var.pop(0), ConstVariable(1))
299
300 def test_clear(self):
301 data = [1, 2, 3]
302 var = ListVariable(data)
303 var.clear()
304 self.assertEqual(var.proxy.length, 0)
305
306 def test_remove(self):
307 data = [1, 2, 3]

Callers

nothing calls this directly

Calls 2

clearMethod · 0.95
ListVariableClass · 0.70

Tested by

no test coverage detected