You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_mindsporelenet.py 466 B

4 years ago
12345678910111213141516
  1. import numpy as np
  2. from .. import MindsporeLeNet
  3. def test_mindsporelenet():
  4. """here is my test code
  5. https://docs.pytest.org/en/stable/getting-started.html#create-your-first-test
  6. """
  7. mln = MindsporeLeNet('lenet/ckpt/checkpoint_lenet-1_1875.ckpt')
  8. tmp = np.random.random([4, 28 * 28])
  9. # The sixth layer is a fully connected layer (F6) with 84 units.
  10. # it is the last layer before the output
  11. assert mln.encode(tmp).shape == (4, 84)