@@ -436,6 +436,38 @@ def test_normalize(tmpdir, df, dataset, gpu_memory_frac, engine, op_columns):
436436 assert new_gdf ["x" ].equals (df ["x" ])
437437
438438
439+ @pytest .mark .parametrize ("gpu_memory_frac" , [0.1 ])
440+ @pytest .mark .parametrize ("engine" , ["parquet" ])
441+ @pytest .mark .parametrize ("op_columns" , [["x" ], None ])
442+ def test_normalize_upcastfloat64 (tmpdir , dataset , gpu_memory_frac , engine , op_columns ):
443+ df = cudf .DataFrame (
444+ {"x" : [1.9e10 , 2.3e16 , 3.4e18 , 1.6e19 ], "label" : [1 , 0 , 1 , 0 ]}, dtype = "float32"
445+ )
446+
447+ cat_names = []
448+ cont_names = ["x" ]
449+ label_name = ["label" ]
450+
451+ config = nvt .workflow .get_new_config ()
452+ config ["PP" ]["continuous" ] = [ops .Moments (columns = op_columns )]
453+
454+ processor = nvtabular .Workflow (
455+ cat_names = cat_names , cont_names = cont_names , label_name = label_name , config = config
456+ )
457+
458+ processor .update_stats (dataset )
459+
460+ op = ops .Normalize ()
461+
462+ columns_ctx = {}
463+ columns_ctx ["continuous" ] = {}
464+ columns_ctx ["continuous" ]["base" ] = op_columns or cont_names
465+
466+ new_gdf = op .apply_op (df , columns_ctx , "continuous" , stats_context = processor .stats )
467+ df ["x" ] = (df ["x" ] - processor .stats ["means" ]["x" ]) / processor .stats ["stds" ]["x" ]
468+ assert new_gdf ["x" ].equals (df ["x" ])
469+
470+
439471@pytest .mark .parametrize ("gpu_memory_frac" , [0.01 , 0.1 ])
440472@pytest .mark .parametrize ("engine" , ["parquet" , "csv" , "csv-no-header" ])
441473@pytest .mark .parametrize ("op_columns" , [["x" ], None ])
0 commit comments