Edit by browser
This commit is contained in:
parent
d52df50055
commit
1670edd027
|
@ -1,13 +1,11 @@
|
||||||
multi_func = lambda x : x*10
|
multi_func = lambda x : x*10
|
||||||
|
|
||||||
def data_pre_handle(data):
|
def data_pre_handle(data):
|
||||||
# 对输入数据依次执行以下操作,然后作为返回值输出
|
# 对输入数据依次执行以下操作,然后作为返回值输出
|
||||||
# 1. 映射,使用上面的multi_func函数作为参数
|
# 1. 映射,使用上面的multi_func函数作为参数
|
||||||
# 2. 分组,每3个分为一组,末尾不足一组的砍掉
|
# 2. 分组,每3个分为一组,末尾不足一组的砍掉
|
||||||
# 3. 重复,将数据重复3次
|
# 3. 重复,将数据重复3次
|
||||||
########## Begin ##########
|
########## Begin ##########
|
||||||
map_res = data.map(operations=multi_func)
|
|
||||||
batch_res = map_res.batch(batch_size=3, drop_remainder=True)
|
|
||||||
repeat_res = batch_res.repeat(3)
|
|
||||||
return repeat_res
|
|
||||||
########## end ##########
|
########## end ##########
|
Loading…
Reference in New Issue