小编Ili*_*hov的帖子

如何确保链代码被另一个链代码调用

假设我们有两种不同的链码:cc1cc2.

如果CC1调用CC2是有办法的α2来检查是否调用是来自CC1.

hyperledger hyperledger-fabric

7
推荐指数
1
解决办法
111
查看次数

Tensorflow:如何使用新的Data API来填充我的示例

我试图按照他们的长度对我的训练样例进行分组:https://www.tensorflow.org/versions/r0.12/api_docs/python/contrib.training/bucketing

但我想使用新的Data API.所以我想知道有没有办法做到这一点.

这是我的代码:

import tensorflow as tf

vocabulary = ["This", "is", "my", "first", "example",
              "the", "second", "one","How", "to", "bucket",
              "examples", "using", "new", "Data", "API"]

data = ["This is my first example",
        "How to bucket my examples using the new Data API",
        "This is the second one",
        "How to bucket my examples using the new Data API"]

BATCH_SIZE = 2

lookup_table = tf.contrib.lookup.index_table_from_tensor(vocabulary)
dataset = tf.data.Dataset.from_tensor_slices(data)


def tokenize(x):
    words = tf.string_split([x], " ").values
    return words


def lookup(x): …
Run Code Online (Sandbox Code Playgroud)

api bucket tensorflow

5
推荐指数
0
解决办法
742
查看次数