tensor_signature_test.py 文件源码

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

项目:lsdc 作者: febert 项目源码 文件源码
def testTensorSignatureExampleParserDict(self):
    examples = tf.placeholder(name='example', shape=[None], dtype=tf.string)
    placeholder_a = tf.placeholder(name='test',
                                   shape=[None, 100],
                                   dtype=tf.int32)
    placeholder_b = tf.placeholder(name='bb',
                                   shape=[None, 100],
                                   dtype=tf.float64)
    inputs = {'a': placeholder_a, 'b': placeholder_b}
    signatures = tensor_signature.create_signatures(inputs)
    result = tensor_signature.create_example_parser_from_signatures(
        signatures, examples)
    self.assertTrue(tensor_signature.tensors_compatible(result, signatures))
    new_signatures = tensor_signature.create_signatures(result)
    self.assertTrue(new_signatures['a'].is_compatible_with(signatures['a']))
    self.assertTrue(new_signatures['b'].is_compatible_with(signatures['b']))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号