评测执行文件
This commit is contained in:
parent
0dfb6cd7f6
commit
d52df50055
|
@ -0,0 +1,19 @@
|
|||
from student_task import data_pre_handle
|
||||
import numpy as np
|
||||
import mindspore.dataset as ds
|
||||
|
||||
# 数据生成函数
|
||||
def generator_func():
|
||||
for i in range(5):
|
||||
yield (np.array([i, i+1, i+2]),)
|
||||
|
||||
if __name__ == '__main__':
|
||||
index = int(input())
|
||||
# 创建数据集
|
||||
ds1 = ds.GeneratorDataset(generator_func, ["data"])
|
||||
func = lambda x: x * index
|
||||
# 执行映射
|
||||
data = ds1.map(operations=func)
|
||||
res = data_pre_handle(data)
|
||||
for data in res.create_dict_iterator():
|
||||
print(data["data"])
|
Loading…
Reference in New Issue