コード例 #1
0
ファイル: test_project.py プロジェクト: zsangel378/mindspore
def test_case_project_between_maps():
    columns = ["col_3d", "col_sint64", "col_2d"]
    parameters = {"params": {'columns': columns}}

    data1 = ds.TFRecordDataset(DATA_DIR_TF, SCHEMA_DIR_TF, shuffle=False)

    type_cast_op = C.TypeCast(mstype.int64)
    data1 = data1.map(input_columns=["col_3d"], operations=type_cast_op)
    data1 = data1.map(input_columns=["col_3d"], operations=type_cast_op)
    data1 = data1.map(input_columns=["col_3d"], operations=type_cast_op)
    data1 = data1.map(input_columns=["col_3d"], operations=type_cast_op)

    data1 = data1.project(columns=columns)

    data1 = data1.map(input_columns=["col_3d"], operations=type_cast_op)
    data1 = data1.map(input_columns=["col_3d"], operations=type_cast_op)
    data1 = data1.map(input_columns=["col_3d"], operations=type_cast_op)
    data1 = data1.map(input_columns=["col_3d"], operations=type_cast_op)
    data1 = data1.map(input_columns=["col_3d"], operations=type_cast_op)

    filename = "project_between_maps_result.npz"
    ordered_save_and_check(data1,
                           parameters,
                           filename,
                           generate_golden=GENERATE_GOLDEN)
コード例 #2
0
ファイル: test_project.py プロジェクト: zsangel378/mindspore
def test_case_project_multiple_columns_out_of_order():
    columns = ["col_3d", "col_sint64", "col_2d"]
    parameters = {"params": {'columns': columns}}

    data1 = ds.TFRecordDataset(DATA_DIR_TF, SCHEMA_DIR_TF, shuffle=False)
    data1 = data1.project(columns=columns)

    filename = "project_multiple_columns_out_of_order_result.npz"
    ordered_save_and_check(data1,
                           parameters,
                           filename,
                           generate_golden=GENERATE_GOLDEN)
コード例 #3
0
ファイル: test_project.py プロジェクト: zimaxeg/mindspore
def test_case_map_project():
    columns = ["col_3d", "col_sint64", "col_2d"]
    parameters = {"params": {'columns': columns}}

    data1 = ds.TFRecordDataset(DATA_DIR_TF, SCHEMA_DIR_TF, shuffle=False)

    no_op = de_map.NoOp()
    data1 = data1.map(input_columns=["col_sint64"], operations=no_op)

    data1 = data1.project(columns=columns)

    filename = "project_map_before_result.npz"
    ordered_save_and_check(data1,
                           parameters,
                           filename,
                           generate_golden=GENERATE_GOLDEN)