def func_encode(sample): x, y = sample features = { 'val': ctf.float_feature([x]), 'label': ctf.float_feature([y]) } return tf.train.Example(features=tf.train.Features(feature=features))
def _encode_func(sample): patch_np = sample[0].numpy().flatten() label_np = sample[1].numpy() return ctfd.encode({ 'patch': ctf.float_feature(patch_np), 'label': ctf.int64_feature(label_np) })