dilation_test.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:sonnet 作者: deepmind 项目源码 文件源码
def testComputation(self):
    with self.test_session() as sess:
      x = sess.run(snt.nets.identity_kernel_initializer([3, 3, 5, 5]))

      # Iterate over elements. Assert that only the middle pixel is on when in
      # and out channels are same.
      it = np.nditer(x, flags=["multi_index"])
      while not it.finished:
        value, idx = it[0], it.multi_index
        (filter_height, filter_width, in_channel, out_channel) = idx
        if (filter_height == 1 and filter_width == 1 and
            in_channel == out_channel):
          self.assertEqual(value, 1)
        else:
          self.assertEqual(value, 0)
        it.iternext()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号