Xenova's picture
Xenova HF Staff
sync 2e7068faf55e
e9fc83c verified
Raw
History Blame
84.8 kB
{
"op": "ai.onnx.GridSample",
"fixtureArrays": {
"onnx_backend_gridsample_volumetric_input_grid": [-1, -1, -1, -1, -0.5, 0.30000001192092896, -0.5, -0.5, -0.5, 1, -0.6000000238418579, -1, -0.20000000298023224, -0.20000000298023224, -0.20000000298023224, 0.4000000059604645, 0.20000000298023224, 0.6000000238418579, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 1, 0, -0.20000000298023224, -0.20000000298023224, -0.20000000298023224, 1, 0.4000000059604645, -0.20000000298023224, 0.5, 0.5, 0.5, -1, -0.800000011920929, 0.800000011920929, 1, 1, 1, 0.4000000059604645, 0.6000000238418579, -0.30000001192092896],
"grid_sample_grid_16": [-1, -0.800000011920929, -0.6000000238418579, -0.5, -0.10000000149011612, -0.20000000298023224, 0.699999988079071, 0, 0, 0.4000000059604645, 0.20000000298023224, -0.20000000298023224, -0.30000001192092896, 0.5, -1, 1],
"onnx_backend_far_coords_zeros_padding_input_grid": [-10, -10, -5, -5, -0.2, -0.2, 10, 10, 10, 10, -0.2, -0.2, 5, 5, 10, 10],
"onnx_backend_gridsample_input_x": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
"onnx_backend_gridsample_aligncorners_true_input_grid": [-1, -1, -0.5, -0.5, -0.20000000298023224, -0.20000000298023224, 0, 0, 0, 0, -0.20000000298023224, -0.20000000298023224, 0.5, 0.5, 1, 1],
"onnx_backend_gridsample_border_padding_input_grid": [-10, -10, -5, -5, -0.20000000298023224, -0.20000000298023224, 10, 10, 10, 10, -0.20000000298023224, -0.20000000298023224, 5, 5, 10, 10]
},
"cases": [
{
"name": "channel_x4_cubic_reflection_c16_f32",
"attrs": { "mode": "cubic", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 16, 4, 4],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.17, "cosStep": 0.09 }
},
"grid": { "dtype": "float32", "shape": [1, 3, 3, 2], "data": { "kind": "linspace", "start": -1.4, "end": 1.4 } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 16, 3, 3], "tolerance": 0.0001, "relTolerance": 0.0001 } }
},
{
"name": "channel_x4_cubic_reflection_align_corners_c4",
"provenance": {
"notes": "Cubic reflection padding with align_corners on over four channels checks the aligned reflection bounds 0 .. dim-1 on the channel-cooperative path."
},
"attrs": { "mode": "cubic", "padding_mode": "reflection", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 4, 4, 4],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.17, "cosStep": 0.09 }
},
"grid": { "dtype": "float32", "shape": [1, 3, 3, 2], "data": { "kind": "linspace", "start": -1.4, "end": 1.4 } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 4, 3, 3], "tolerance": 0.0001, "relTolerance": 0.0001 } }
},
{
"name": "channel_x4_linear_reflection_c4",
"provenance": {
"notes": "Bilinear reflection padding with align_corners off over four channels checks the half-pixel reflection bounds on the channel-cooperative path."
},
"attrs": { "mode": "linear", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 4, 4, 5],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.23, "cosStep": 0.11 }
},
"grid": { "dtype": "float32", "shape": [1, 3, 4, 2], "data": { "kind": "linspace", "start": -1.6, "end": 1.4 } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 4, 3, 4], "tolerance": 0.0001, "relTolerance": 0.0001 } }
},
{
"name": "channel_x4_linear_border_c8_f32",
"attrs": { "mode": "linear", "padding_mode": "border", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 8, 5, 5],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.13, "cosStep": 0.07 }
},
"grid": { "dtype": "float32", "shape": [1, 4, 4, 2], "data": { "kind": "linspace", "start": -1.2, "end": 1.2 } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 8, 4, 4], "tolerance": 0.00001, "relTolerance": 0.00001 } }
},
{
"name": "linear_zeros_exact_subnormal_pixel_gpu_gap",
"skipGpu": {
"category": "permanent",
"reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: Metal flushes denormals to zero in the ALU; bilinear/trilinear interpolation arithmetic flushes the subnormal pixel/voxel on GPU. Permanent FTZ limitation."
},
"provenance": {
"notes": "Exact corner sampling with align_corners=1 should copy the positive subnormal source pixel through the bilinear path."
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2],
"data": { "kind": "values", "values": [1e-40, 0.0, 0.0, 0.0] }
},
"grid": { "dtype": "float32", "shape": [1, 1, 1, 2], "data": { "kind": "values", "values": [-1.0, -1.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 1], "tolerance": 0 } }
},
{
"name": "linear_zeros_exact_subnormal_voxel_gpu_gap",
"skipGpu": {
"category": "permanent",
"reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: Metal flushes denormals to zero in the ALU; bilinear/trilinear interpolation arithmetic flushes the subnormal pixel/voxel on GPU. Permanent FTZ limitation."
},
"provenance": {
"notes": "Rank-5 companion: exact corner sampling should copy the positive subnormal source voxel through the trilinear path."
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1e-40, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 3],
"data": { "kind": "values", "values": [-1.0, -1.0, -1.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 1, 1], "tolerance": 0 } }
},
{
"name": "dispatch_cliff_nchw_over_16m_elements",
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 256, 8, 8] },
"grid": {
"dtype": "float32",
"shape": [1, 256, 256, 2],
"data": { "kind": "linspace", "start": -1.0, "end": 1.0 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 256, 256, 256], "tolerance": 0.0001 } }
},
{
"name": "dispatch_cliff_ncdhw_over_16m_elements",
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 64, 8, 8, 8] },
"grid": {
"dtype": "float32",
"shape": [1, 64, 64, 64, 3],
"data": { "kind": "linspace", "start": -1.0, "end": 1.0 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 64, 64, 64, 64], "tolerance": 0.0001 } }
},
{
"name": "linear_zeros_align_corners",
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2],
"data": { "kind": "values", "values": [-1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 2] } },
"tolerance": 0.000001
},
{
"name": "ort_linear_zeros_align_corners_rank4",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_gen.py",
"test": "GridSampleTest.test_grid_sample_16_4D_bilinear_zeros_align_corners",
"notes": "Generated ORT fixture materialized in grid_sample_test.cc; opset-20 spelling uses mode=linear for the 4D bilinear case."
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 3, 2],
"data": {
"kind": "values",
"values": [0.294201, 0.797322, 1.264215, 0.935492, 0.545464, -1.537389, 0.312439, 0.74006, -0.575326, -1.432532, -0.666175, 1.017438, -2.241368, 0.437349, -0.555362, -0.057943, 0.658583, 0.992938, -0.206548, -0.244841, -0.380599, 1.131112, -0.090205, -0.8979]
}
},
"grid": {
"dtype": "float32",
"shape": [2, 3, 2, 2],
"data": {
"kind": "values",
"values": [0.595248, -1.096726, -0.214731, -0.891773, -0.512023, 0.432352, -0.852156, 0.446072, 1.018534, 0.078706, -0.799785, -0.429942, 0.262037, -0.914782, 0.596172, -1.089444, -1.153552, -1.165993, -0.243436, 0.80692, -1.135775, 0.997425, -0.480027, 0.351461]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2, 3, 2], "tolerance": 0.00001 } }
},
{
"name": "nearest_border",
"attrs": { "mode": "nearest", "padding_mode": "border", "align_corners": 1 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [-2.0, -2.0, 0.0, 0.0, 2.0, 2.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 3] } }
},
{
"name": "linear_f16",
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float16", "shape": [1, 1, 2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
"grid": {
"dtype": "float16",
"shape": [1, 1, 2, 2],
"data": { "kind": "values", "values": [0.0, 0.0, 1.0, 0.0] }
}
},
"outputs": { "y": { "dtype": "float16", "shape": [1, 1, 1, 2] } },
"tolerance": 0.002
},
{
"name": "nearest_reflection_extreme_coords_ort",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_nearest_reflection_extreme_coords"
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 2, 2],
"data": { "kind": "values", "values": [10000000000.0, 10000000000.0, -10000000000.0, -10000000000.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 2], "tolerance": 0.000001 } }
},
{
"name": "linear_reflection_far_coords_ort",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_bilinear_reflection_extreme_coords",
"notes": "Uses smaller finite coordinates than ORT's extreme-coordinate regression while preserving the reflection boundary path."
},
"attrs": { "mode": "linear", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 2, 2],
"data": { "kind": "values", "values": [5.0, 5.0, -5.0, -5.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 2], "tolerance": 0.000001 } }
},
{
"name": "cubic_reflection_extreme_coords_ort",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTestFloatOnly.test_grid_sample_20_4D_cubic_reflection_extreme_coords"
},
"attrs": { "mode": "cubic", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 4, 4], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 2],
"data": { "kind": "values", "values": [10000000000.0, -10000000000.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 1], "tolerance": 0.0001 } }
},
{
"name": "nearest_reflection_extreme_coords_rank5",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_5D_nearest_reflection_extreme_coords",
"notes": "Covers ONNX 5D/volumetric nearest sampling with reflection padding."
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 2, 3],
"data": {
"kind": "values",
"values": [10000000000.0, 10000000000.0, 10000000000.0, -10000000000.0, -10000000000.0, -10000000000.0]
}
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 2],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [1.0, 1.0] }
}
}
},
{
"name": "linear_zeros_mixed_bounds_right_bottom_ort",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_linear_zeros_mixed_bounds_right_bottom",
"notes": "Projection onto a 3x3 source image; it preserves ORT's right/bottom zero-padding boundary behavior."
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 3],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 4, 2],
"data": { "kind": "values", "values": [1.0, 1.0, 0.8, 1.0, 1.0, 0.8, 1.2, 1.2] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 4], "tolerance": 0.000001 } }
},
{
"name": "linear_border_batch2_channels2_ort",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_4D_bilinear_border_no_align_corners",
"notes": "Projection using deterministic generated data to cover batch and channel indexing in the same border/no-align mode."
},
"attrs": { "mode": "linear", "padding_mode": "border", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 3, 2],
"data": { "kind": "fillFloat32", "scale": 0.7, "sinStep": 0.13, "cosStep": 0.29 }
},
"grid": {
"dtype": "float32",
"shape": [2, 2, 2, 2],
"data": {
"kind": "values",
"values": [-1.1, -0.9, 0.25, -0.25, 0.8, 0.6, 1.2, 1.1, -0.4, 0.7, 0.0, 0.0, 0.9, -1.2, -1.3, 1.3]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2, 2, 2], "tolerance": 0.000001 } }
},
{
"name": "cubic_zeros_fractional_multichannel",
"attrs": { "mode": "cubic", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 2, 4, 4],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.17, "cosStep": 0.11 }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2],
"data": { "kind": "values", "values": [-0.5, -0.5, 0.25, -0.25, 0.75, 0.5, 1.2, -1.2] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 2, 2, 2], "tolerance": 0.0001 } }
},
{
"name": "ort_linear_border_align_corners_compact",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_16_4D_bilinear_border_align_corners",
"notes": "Compact opset-20 projection using mode=linear for ORT's generated 4D bilinear border align-corners case."
},
"attrs": { "mode": "linear", "padding_mode": "border", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 3],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 3, 2],
"data": { "kind": "values", "values": [-1.5, -1.0, 0.0, 0.0, 1.5, 1.0, -1.0, 1.2, 0.5, -1.2, 1.0, 0.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 3], "tolerance": 0.00001 } }
},
{
"name": "ort_linear_reflection_align_corners_compact",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_4D_bilinear_reflection_align_corners",
"notes": "Compact opset-20 projection using mode=linear for ORT's generated 4D bilinear reflection align-corners case."
},
"attrs": { "mode": "linear", "padding_mode": "reflection", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 3],
"data": { "kind": "values", "values": [1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2],
"data": { "kind": "values", "values": [-1.4, -1.4, 1.4, 1.4, 0.25, -0.5, -2.2, 0.6] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 2], "tolerance": 0.00001 } }
},
{
"name": "ort_cubic_border_no_align_corners_compact",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_4D_bicubic_border_no_align_corners",
"notes": "Compact projection of ORT's generated 4D bicubic border no-align case; opset-20 spelling uses mode=cubic."
},
"attrs": { "mode": "cubic", "padding_mode": "border", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 3],
"data": { "kind": "values", "values": [-2.0, -1.0, 0.0, 1.0, 3.0, 5.0, 8.0, 13.0, 21.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2],
"data": { "kind": "values", "values": [0.2, -0.6, 1.2, 1.2, -1.1, 0.0, 0.0, 0.8] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 2], "tolerance": 0.00001 } }
},
{
"name": "ort_cubic_reflection_align_corners_compact",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_4D_bicubic_reflection_align_corners",
"notes": "Compact projection of ORT's generated 4D bicubic reflection align-corners case; opset-20 spelling uses mode=cubic."
},
"attrs": { "mode": "cubic", "padding_mode": "reflection", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 3],
"data": { "kind": "values", "values": [0.0, 1.0, 0.0, 2.0, 4.0, 2.0, 0.0, 1.0, 0.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2],
"data": { "kind": "values", "values": [-1.25, -1.25, 1.25, -0.25, -0.6, 1.3, 0.3, 0.4] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 2], "tolerance": 0.00001 } }
},
{
"name": "nearest_reflection_dim1_align_corners_ort",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_nearest_reflection_dim1_align_corners",
"notes": "Extends ORT's dim-1 reflection case to a width-3 input so the same row-degenerate path also checks horizontal sampling."
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 1 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 1, 3], "data": { "kind": "values", "values": [10.0, 20.0, 30.0] } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 5, 2],
"data": { "kind": "values", "values": [-2.0, -2.0, -1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 2.0, 2.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 5], "tolerance": 0.000001 } }
},
{
"name": "onnx_backend_far_coords_zeros_padding",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/case/node/gridsample.py",
"test": "test_gridsample_zeros_padding"
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_far_coords_zeros_padding_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } }
},
{
"name": "onnx_backend_far_coords_border_padding",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/case/node/gridsample.py",
"test": "test_gridsample_border_padding"
},
"attrs": { "mode": "linear", "padding_mode": "border", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_far_coords_zeros_padding_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } }
},
{
"name": "onnx_backend_far_coords_reflection_padding",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/case/node/gridsample.py",
"test": "test_gridsample_reflection_padding"
},
"attrs": { "mode": "linear", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_far_coords_zeros_padding_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } }
},
{
"name": "onnx_backend_cubic_mode",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/case/node/gridsample.py",
"test": "test_gridsample_bicubic"
},
"attrs": { "mode": "cubic", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": [-1.0, -1.0, -0.5, -0.5, -0.2, -0.2, 0.0, 0.0, 0.0, 0.0, -0.2, -0.2, 0.5, 0.5, 1.0, 1.0]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0002 } }
},
{
"name": "ort_nearest_zeros_align",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_16_4D_nearest_zeros_align_corners"
},
"attrs": { "mode": "nearest", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 3, 2],
"data": {
"kind": "values",
"values": [-1.12584, -1.15236, -0.250579, -0.433879, 0.84871, 0.692009, -0.316013, -2.115219, 0.468096, -0.157712, 1.44366, 0.266049, 0.166455, 0.874382, -0.143474, -0.111609, 0.931827, 1.259009, 2.004981, 0.053737, 0.618057, -0.412802, -0.841065, -2.316042]
}
},
"grid": {
"dtype": "float32",
"shape": [2, 3, 2, 2],
"data": {
"kind": "values",
"values": [0.06311, -0.61522, 0.203022, -1.120434, -0.867079, -0.618636, 0.757125, 0.703586, -0.532194, -0.043299, 0.767473, 1.19296, 0.476259, 0.162111, 0.804584, -0.706563, 0.223613, -0.930367, -0.831703, -0.6199, 0.542968, 0.482592, -0.710823, 0.362529]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2, 3, 2], "tolerance": 0 } }
},
{
"name": "ort_nearest_zeros_no_align",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_16_4D_nearest_zeros_no_align_corners"
},
"attrs": { "mode": "nearest", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 3, 2],
"data": {
"kind": "values",
"values": [-0.569248, 0.919971, 1.110816, 1.289874, -1.478174, 2.567233, -0.47312, 0.335551, -0.003304, -0.534441, 1.168688, 0.394503, 1.941462, 0.791498, -0.020252, -0.43717, -1.535287, -0.412679, 0.966303, 1.624783, -0.365619, -1.30244, 0.099403, 0.441822]
}
},
"grid": {
"dtype": "float32",
"shape": [2, 3, 2, 2],
"data": {
"kind": "values",
"values": [-1.143118, -0.021569, -0.903671, -0.925628, -0.06612, 0.180174, -0.491436, 0.712053, -0.730247, 1.088844, 0.82236, -1.01194, -0.298661, 0.054147, 0.175081, 0.284609, 0.470914, 0.07188, -0.585515, 0.567827, -1.151099, -0.711248, -0.300396, -0.584536]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2, 3, 2], "tolerance": 0 } }
},
{
"name": "ort_nearest_border_align",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_16_4D_nearest_border_align_corners"
},
"attrs": { "mode": "nearest", "padding_mode": "border", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 3, 2],
"data": {
"kind": "values",
"values": [-0.883376, -0.418913, -0.804826, 0.56561, 0.610365, 0.466884, 1.950657, -1.063099, -0.829367, -1.407257, 1.626847, 0.172273, -1.611502, -0.479448, -0.143351, -0.317295, 0.573655, 0.997931, 0.543609, 0.078804, 0.86286, -0.01949, 0.991047, -0.777735]
}
},
"grid": {
"dtype": "float32",
"shape": [2, 3, 2, 2],
"data": {
"kind": "values",
"values": [-1.08007, -0.080985, 1.055303, -0.48947, 1.083604, 0.434584, -1.082953, 0.759237, -0.138473, -0.535688, 0.959584, -0.969714, 0.128766, -0.251242, 0.856935, 0.334973, 0.576606, 0.423791, -0.28857, -0.252367, -0.988898, 0.650213, 0.952774, 0.82107]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2, 3, 2], "tolerance": 0 } }
},
{
"name": "ort_nearest_border_no_align",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_16_4D_nearest_border_no_align_corners"
},
"attrs": { "mode": "nearest", "padding_mode": "border", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 3, 2],
"data": {
"kind": "values",
"values": [-0.55963, 0.533472, 0.406887, 0.394587, 0.171511, 0.876045, -0.287087, 1.02164, 0.438649, -0.010704, 1.338354, -0.279405, -0.551834, -2.889061, -1.509981, 1.024115, 0.195393, -0.737109, 1.700101, 0.346216, 0.971125, 1.45025, -0.051909, -0.628431]
}
},
"grid": {
"dtype": "float32",
"shape": [2, 3, 2, 2],
"data": {
"kind": "values",
"values": [0.149807, 1.074831, 0.734055, -0.758657, 0.538205, -0.848275, -0.50859, 0.352947, 0.396231, 0.900274, -0.386299, 0.001921, 0.617788, -1.160511, 0.867577, -0.992307, 0.016539, -0.20402, -0.632008, 0.158605, 0.992302, -0.350783, -0.712433, -0.443807]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2, 3, 2], "tolerance": 0 } }
},
{
"name": "ort_nearest_reflection_align",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_16_4D_nearest_reflection_align_corners"
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 3, 2],
"data": {
"kind": "values",
"values": [-0.039373, -0.801472, -0.495544, -0.361514, 0.585113, -1.156007, -0.143365, -0.194741, -0.906885, -0.591838, 0.150785, -1.041149, -0.720534, -2.214754, -0.68373, 0.516358, 0.792848, 0.083228, 0.4228, -1.868747, -1.105713, 0.143731, 0.583597, 1.348155]
}
},
"grid": {
"dtype": "float32",
"shape": [2, 3, 2, 2],
"data": {
"kind": "values",
"values": [0.829854, -0.893309, 0.491599, -0.403504, -0.578962, 0.215574, -0.623348, 0.276486, 0.235657, -0.890987, 0.199798, 0.511115, 0.474997, -0.151054, -0.983745, -0.184985, 0.416769, -0.437853, 0.455497, 0.799155, -0.626582, 0.011834, 0.496199, 0.094053]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2, 3, 2], "tolerance": 0 } }
},
{
"name": "ort_nearest_reflection_no_align",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_16_4D_nearest_reflection_no_align_corners"
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [2, 2, 3, 2],
"data": {
"kind": "values",
"values": [-0.12923, -0.054595, 0.408347, 1.126366, 1.935057, 1.007685, 1.004642, -0.43352, -0.562711, -0.832754, -1.395545, -0.399295, -0.30994, -0.056062, 0.517413, -1.596237, 0.35696, -2.297482, -0.871083, -1.674028, 0.563055, -1.435067, 0.7194, -1.370747]
}
},
"grid": {
"dtype": "float32",
"shape": [2, 3, 2, 2],
"data": {
"kind": "values",
"values": [-0.81191, -1.183845, -0.963667, 0.947364, 0.649243, 1.125859, 0.961345, -1.071655, -0.818917, -0.193899, -0.779319, 0.833276, -0.907209, -0.585482, -1.15931, -0.681295, 0.986973, 0.982512, 0.859005, 0.926553, 1.067024, -0.307276, 0.528003, 1.069117]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2, 3, 2], "tolerance": 0 } }
},
{
"name": "ort_custom_linear_zeros_mixed_bounds_right_bottom",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_linear_zeros_mixed_bounds_right_bottom"
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2],
"data": { "kind": "values", "values": [0.0, 0.0, 0.9, 0.0, 0.0, 0.9, 0.9, 0.9] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 2], "tolerance": 0.000001 } }
},
{
"name": "ort_custom_linear_zeros_mixed_bounds_left_top",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_linear_zeros_mixed_bounds_left_top"
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0] } },
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2],
"data": { "kind": "values", "values": [0.0, 0.0, -0.9, 0.0, 0.0, -0.9, -0.9, -0.9] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 2], "tolerance": 0.000001 } }
},
{
"name": "ort_custom_nearest_reflection_nan_coords",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_nearest_reflection_nan_coords"
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 2, 2],
"data": { "kind": "values", "values": ["NaN", "NaN", 0.0, "NaN"] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 2], "tolerance": 0.000001 } }
},
{
"name": "ort_custom_linear_reflection_infinity_coords",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_bilinear_reflection_infinity_coords"
},
"attrs": { "mode": "linear", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 2, 2],
"data": { "kind": "values", "values": ["Infinity", "-Infinity", "-Infinity", "Infinity"] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 2], "tolerance": 0.000001 } }
},
{
"name": "ort_custom_linear_reflection_extreme_coords",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_bilinear_reflection_extreme_coords"
},
"attrs": { "mode": "linear", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 2, 2],
"data": {
"kind": "values",
"values": [100000000000000000000.0, 100000000000000000000.0, -100000000000000000000.0, -100000000000000000000.0]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 2], "tolerance": 0.000001 } }
},
{
"name": "ort_custom_linear_border_extreme_coords",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_bilinear_border_extreme_coords"
},
"attrs": { "mode": "linear", "padding_mode": "border", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 2, 2],
"data": {
"kind": "values",
"values": [100000000000000000000.0, 100000000000000000000.0, -100000000000000000000.0, -100000000000000000000.0]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 2], "tolerance": 0.000001 } }
},
{
"name": "ort_custom_linear_zeros_extreme_nan_inf_coords",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_linear_zeros_extreme_nan_inf_coords"
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": {
"kind": "values",
"values": ["NaN", "NaN", "Infinity", "-Infinity", 100000000000000000000.0, -100000000000000000000.0]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 3], "tolerance": 0.000001 } }
},
{
"name": "ort_custom_cubic_reflection_nan_inf_coords",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTestFloatOnly.test_grid_sample_20_4D_cubic_reflection_nan_inf_coords"
},
"attrs": { "mode": "cubic", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 4, 4], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": ["NaN", "NaN", "Infinity", "-Infinity", "-Infinity", "Infinity"] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 3], "tolerance": 0.0001 } }
},
{
"name": "ort_custom_nearest_reflection_align_corners_extreme",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_nearest_reflection_align_corners_extreme"
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 3],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 2, 2],
"data": { "kind": "values", "values": [100000000000000000000.0, 100000000000000000000.0, "NaN", "-Infinity"] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 2], "tolerance": 0.000001 } }
},
{
"name": "ort_custom_nearest_reflection_negative_only_extreme",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_nearest_reflection_negative_only_extreme"
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 3],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 2, 2],
"data": {
"kind": "values",
"values": [-100000000000000000000.0, -100000000000000000000.0, "-Infinity", "-Infinity"]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 2], "tolerance": 0.000001 } }
},
{
"name": "ort_custom_nearest_reflection_mixed_normal_pathological",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_4D_nearest_reflection_mixed_normal_pathological"
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 3],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 4, 2],
"data": {
"kind": "values",
"values": [0.0, 0.0, -1.0, -1.0, "NaN", "NaN", 100000000000000000000.0, -100000000000000000000.0]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 4], "tolerance": 0.000001 } }
},
{
"name": "onnx_backend_gridsample",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 4, 4],
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_input_x" } }
},
"grid": {
"dtype": "float32",
"shape": [1, 6, 6, 2],
"data": {
"kind": "values",
"values": [-1.0, -1.0, -0.6000000238418579, -1.0, -0.20000000298023224, -1.0, 0.20000000298023224, -1.0, 0.6000000238418579, -1.0, 1.0, -1.0, -1.0, -0.6000000238418579, -0.6000000238418579, -0.6000000238418579, -0.20000000298023224, -0.6000000238418579, 0.20000000298023224, -0.6000000238418579, 0.6000000238418579, -0.6000000238418579, 1.0, -0.6000000238418579, -1.0, -0.20000000298023224, -0.6000000238418579, -0.20000000298023224, -0.20000000298023224, -0.20000000298023224, 0.20000000298023224, -0.20000000298023224, 0.6000000238418579, -0.20000000298023224, 1.0, -0.20000000298023224, -1.0, 0.20000000298023224, -0.6000000238418579, 0.20000000298023224, -0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 0.6000000238418579, 0.20000000298023224, 1.0, 0.20000000298023224, -1.0, 0.6000000238418579, -0.6000000238418579, 0.6000000238418579, -0.20000000298023224, 0.6000000238418579, 0.20000000298023224, 0.6000000238418579, 0.6000000238418579, 0.6000000238418579, 1.0, 0.6000000238418579, -1.0, 1.0, -0.6000000238418579, 1.0, -0.20000000298023224, 1.0, 0.20000000298023224, 1.0, 0.6000000238418579, 1.0, 1.0, 1.0]
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 6, 6], "tolerance": 0.0001 } },
"attrs": { "align_corners": 0, "mode": "linear", "padding_mode": "zeros" }
},
{
"name": "onnx_backend_gridsample_aligncorners_true",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_aligncorners_true" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_aligncorners_true_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "align_corners": 1, "mode": "linear" }
},
{
"name": "onnx_backend_gridsample_bicubic",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_bicubic" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_aligncorners_true_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "mode": "cubic" }
},
{
"name": "onnx_backend_gridsample_bicubic_align_corners_0_additional_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_bicubic_align_corners_0_additional_1"
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/grid_sample_grid_16" } }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "align_corners": 0, "mode": "cubic" }
},
{
"name": "onnx_backend_gridsample_bicubic_align_corners_1_additional_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_bicubic_align_corners_1_additional_1"
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/grid_sample_grid_16" } }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "align_corners": 1, "mode": "cubic" }
},
{
"name": "onnx_backend_gridsample_bilinear",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_bilinear" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_aligncorners_true_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "mode": "linear" }
},
{
"name": "onnx_backend_gridsample_bilinear_align_corners_0_additional_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_bilinear_align_corners_0_additional_1"
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/grid_sample_grid_16" } }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "align_corners": 0, "mode": "linear" }
},
{
"name": "onnx_backend_gridsample_bilinear_align_corners_1_additional_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_bilinear_align_corners_1_additional_1"
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/grid_sample_grid_16" } }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "align_corners": 1, "mode": "linear" }
},
{
"name": "onnx_backend_gridsample_border_padding",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_border_padding" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_border_padding_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "padding_mode": "border" }
},
{
"name": "onnx_backend_gridsample_nearest",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_nearest" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_aligncorners_true_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "mode": "nearest" }
},
{
"name": "onnx_backend_gridsample_nearest_align_corners_0_additional_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_nearest_align_corners_0_additional_1"
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/grid_sample_grid_16" } }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "align_corners": 0, "mode": "nearest" }
},
{
"name": "onnx_backend_gridsample_nearest_align_corners_1_additional_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_nearest_align_corners_1_additional_1"
},
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/grid_sample_grid_16" } }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "align_corners": 1, "mode": "nearest" }
},
{
"name": "onnx_backend_gridsample_reflection_padding",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_reflection_padding" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_border_padding_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "padding_mode": "reflection" }
},
{
"name": "onnx_backend_gridsample_zeros_padding",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_zeros_padding" },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2],
"data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_border_padding_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4], "tolerance": 0.0001 } },
"attrs": { "padding_mode": "zeros" }
},
{
"name": "onnx_backend_gridsample_volumetric_bilinear_align_corners_0",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_volumetric_bilinear_align_corners_0"
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2, 3],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_volumetric_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4, 2], "tolerance": 0.00001 } }
},
{
"name": "onnx_backend_gridsample_volumetric_bilinear_align_corners_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_volumetric_bilinear_align_corners_1"
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2, 3],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_volumetric_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4, 2], "tolerance": 0.00001 } }
},
{
"name": "onnx_backend_gridsample_volumetric_nearest_align_corners_0",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_volumetric_nearest_align_corners_0"
},
"attrs": { "mode": "nearest", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2, 3],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_volumetric_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4, 2], "tolerance": 0 } }
},
{
"name": "onnx_backend_gridsample_volumetric_nearest_align_corners_1",
"provenance": {
"source": "cmake/external/onnx/onnx/backend/test/data/node/test_gridsample_volumetric_nearest_align_corners_1"
},
"attrs": { "mode": "nearest", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 4, 2, 3],
"data": {
"kind": "values",
"values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_volumetric_input_grid" }
}
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 4, 2], "tolerance": 0 } }
},
{
"name": "ort_5d_nearest_zeros_align_corners_simple",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_5D_nearest_zeros_align_corners",
"notes": "Compact node-level projection of ORT's generated 5D nearest zeros case."
},
"attrs": { "mode": "nearest", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 3, 3],
"data": { "kind": "values", "values": [-1.0, -1.0, -1.0, 1.0, 1.0, 1.0, 3.0, 0.0, 0.0] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 3],
"tolerance": 0,
"data": { "kind": "values", "values": [1.0, 8.0, 0.0] }
}
}
},
{
"name": "ort_5d_nearest_zeros_no_align_corners_simple",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_5D_nearest_zeros_no_align_corners",
"notes": "Uses normalized coordinates that map exactly to both volume corners when align_corners=0."
},
"attrs": { "mode": "nearest", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 3, 3],
"data": { "kind": "values", "values": [-0.5, -0.5, -0.5, 0.5, 0.5, 0.5, 1.5, 0.0, 0.0] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 3],
"tolerance": 0,
"data": { "kind": "values", "values": [1.0, 8.0, 0.0] }
}
}
},
{
"name": "ort_5d_linear_zeros_align_corners_simple",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_5D_bilinear_zeros_align_corners",
"notes": "Opset-20 5D bilinear is represented as mode=linear."
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 3, 3],
"data": { "kind": "values", "values": [-1.0, -1.0, -1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 3],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [1.0, 4.5, 8.0] }
}
}
},
{
"name": "ort_5d_linear_zeros_no_align_corners_simple",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_22_5D_bilinear_zeros_no_align_corners",
"notes": "Uses exact corner/center coordinates for align_corners=0."
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 3, 3],
"data": { "kind": "values", "values": [-0.5, -0.5, -0.5, 0.0, 0.0, 0.0, 0.5, 0.5, 0.5] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 3],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [1.0, 4.5, 8.0] }
}
}
},
{
"name": "ort_custom_5d_nearest_reflection_extreme_coords",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_5D_nearest_reflection_extreme_coords"
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 2, 3],
"data": {
"kind": "values",
"values": [10000000000.0, 10000000000.0, 10000000000.0, -10000000000.0, -10000000000.0, -10000000000.0]
}
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 2],
"tolerance": 0,
"data": { "kind": "values", "values": [1.0, 1.0] }
}
}
},
{
"name": "ort_5d_nearest_border_no_align_corners",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_5D_nearest_border_no_align_corners",
"notes": "Compact projection of ORT's generated 5D nearest border/no-align case."
},
"attrs": { "mode": "nearest", "padding_mode": "border", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 3, 3],
"data": { "kind": "values", "values": [-2.0, -2.0, -2.0, 0.5, 0.5, 0.5, 2.0, 2.0, 2.0] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 3],
"tolerance": 0,
"data": { "kind": "values", "values": [1.0, 8.0, 8.0] }
}
}
},
{
"name": "ort_5d_nearest_reflection_align_corners",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_5D_nearest_reflection_align_corners",
"notes": "Compact projection of ORT's generated 5D nearest reflection/align-corners case."
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 3, 3],
"data": { "kind": "values", "values": [-2.0, -2.0, -2.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 1, 3], "tolerance": 0 } }
},
{
"name": "ort_5d_linear_border_align_corners",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_22_5D_bilinear_border_align_corners",
"notes": "Compact opset-20 projection using mode=linear for ORT's generated 5D bilinear border/align-corners case."
},
"attrs": { "mode": "linear", "padding_mode": "border", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 3, 3],
"data": { "kind": "values", "values": [-2.0, -2.0, -2.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 1, 3], "tolerance": 0.000001 } }
},
{
"name": "ort_5d_linear_reflection_no_align_corners",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_22_5D_bilinear_reflection_no_align_corners",
"notes": "Compact opset-20 projection using mode=linear for ORT's generated 5D bilinear reflection/no-align case."
},
"attrs": { "mode": "linear", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 3, 3],
"data": { "kind": "values", "values": [-2.0, -2.0, -2.0, 0.0, 0.0, 0.0, 2.0, 2.0, 2.0] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 1, 3], "tolerance": 0.000001 } }
},
{
"name": "ort_5d_nearest_border_align_corners",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_5D_nearest_border_align_corners",
"notes": "Compact 5D border-padding projection of ORT's generated align-corners case."
},
"attrs": { "mode": "nearest", "padding_mode": "border", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 4, 3],
"data": { "kind": "values", "values": [-2.0, -2.0, -2.0, 2.0, 2.0, 2.0, 0.2, -0.2, 0.6, -0.6, 0.6, -0.2] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 4],
"tolerance": 0,
"data": { "kind": "values", "values": [1.0, 8.0, 6.0, 3.0] }
}
}
},
{
"name": "ort_custom_5d_nearest_reflection_nan_inf_coords",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_5D_nearest_reflection_nan_inf_coords"
},
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 2, 3],
"data": { "kind": "values", "values": ["NaN", "Infinity", "-Infinity", "Infinity", "NaN", "-Infinity"] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 2],
"tolerance": 0,
"data": { "kind": "values", "values": [1.0, 1.0] }
}
}
},
{
"name": "ort_linear_zeros_no_align_corners_compact",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_16_4D_bilinear_zeros_no_align_corners",
"notes": "Opset-20 spelling uses mode=linear for ORT's generated 4D bilinear no-align case."
},
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 3],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 3, 2],
"data": { "kind": "values", "values": [-1.0, -1.0, 0.0, 0.0, 1.0, 1.0, -1.2, 0.4, 0.4, -1.2, 1.2, 1.2] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 3], "tolerance": 0.000001 } }
},
{
"name": "ort_linear_reflection_no_align_corners_compact",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_16_4D_bilinear_reflection_no_align_corners",
"notes": "Compact projection of ORT's 4D bilinear reflection no-align coverage."
},
"attrs": { "mode": "linear", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 3, 3],
"data": { "kind": "values", "values": [1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2],
"data": { "kind": "values", "values": [-1.4, -1.4, 1.4, 1.4, -0.2, 0.6, 2.2, -0.6] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 2], "tolerance": 0.00001 } }
},
{
"name": "ort_cubic_zeros_no_align_corners_compact",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_20_4D_bicubic_zeros_no_align_corners",
"notes": "Opset-20 spelling uses mode=cubic for ORT's generated 4D bicubic zeros no-align case."
},
"attrs": { "mode": "cubic", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 4, 4],
"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_gridsample_input_x" } }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2],
"data": { "kind": "values", "values": [-0.6, -0.6, 0.4, -0.2, 1.2, 1.2, -1.1, 0.3] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 2, 2], "tolerance": 0.0001 } }
},
{
"name": "ort_linear_border_rank5_no_align_corners",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc",
"test": "GridSampleTest.test_grid_sample_22_5D_bilinear_border_no_align_corners",
"notes": "Valid 5D trilinear border-padding case."
},
"attrs": { "mode": "linear", "padding_mode": "border", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 2],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0] }
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 3, 3],
"data": { "kind": "values", "values": [-1.2, -1.2, -1.2, 0.0, 0.0, 0.0, 1.2, 1.2, 1.2] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 1, 1, 1, 3], "tolerance": 0.000001 } }
},
{
"name": "ort_linear_reflection_rank5_extreme",
"provenance": {
"source": "onnxruntime/test/providers/cpu/tensor/grid_sample_test_custom.cc",
"test": "GridSampleCustomTest.test_grid_sample_20_5D_linear_reflection_extreme_coords",
"notes": "Valid 5D trilinear reflection-padding case with extreme coordinates."
},
"attrs": { "mode": "linear", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2, 2], "data": { "kind": "constant", "value": 1.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 2, 3],
"data": {
"kind": "values",
"values": [100000000000000000000.0, 100000000000000000000.0, 100000000000000000000.0, -100000000000000000000.0, -100000000000000000000.0, -100000000000000000000.0]
}
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 2],
"data": { "kind": "values", "values": [1.0, 1.0] },
"tolerance": 0.000001
}
}
},
{
"name": "empty_input_zero_dim",
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": { "dtype": "float32", "shape": [0, 1, 2, 2], "data": { "kind": "values", "values": [] } },
"grid": { "dtype": "float32", "shape": [0, 2, 2, 2], "data": { "kind": "values", "values": [] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [0, 1, 2, 2], "tolerance": 0 } }
},
{
"name": "ort_caseB_empty",
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 0, 2], "data": { "kind": "values", "values": [] } },
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2],
"data": { "kind": "values", "values": [-1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, 1.0] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 2, 2],
"data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] },
"tolerance": 0.001
}
}
},
{
"name": "f16_linear_zeros_feature_warp",
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float16",
"shape": [1, 32, 32, 32],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.07, "cosStep": 0.13 }
},
"grid": {
"dtype": "float16",
"shape": [1, 32, 32, 2],
"data": { "kind": "linspace", "start": -1.0, "end": 1.0 }
}
},
"outputs": { "y": { "dtype": "float16", "shape": [1, 32, 32, 32], "tolerance": 0.02, "relTolerance": 0.02 } }
},
{
"name": "f16_linear_border_align_corners_stn",
"attrs": { "mode": "linear", "padding_mode": "border", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float16",
"shape": [1, 16, 24, 24],
"data": { "kind": "fillFloat32", "scale": 0.4, "sinStep": 0.11, "cosStep": 0.19 }
},
"grid": {
"dtype": "float16",
"shape": [1, 24, 24, 2],
"data": { "kind": "linspace", "start": -1.2, "end": 1.2 }
}
},
"outputs": { "y": { "dtype": "float16", "shape": [1, 16, 24, 24], "tolerance": 0.02, "relTolerance": 0.02 } }
},
{
"name": "f16_volumetric_linear_zeros_3d_warp",
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float16",
"shape": [1, 4, 8, 16, 16],
"data": { "kind": "fillFloat32", "scale": 0.5, "sinStep": 0.05, "cosStep": 0.09 }
},
"grid": {
"dtype": "float16",
"shape": [1, 8, 16, 16, 3],
"data": { "kind": "linspace", "start": -1.0, "end": 1.0 }
}
},
"outputs": { "y": { "dtype": "float16", "shape": [1, 4, 8, 16, 16], "tolerance": 0.03, "relTolerance": 0.03 } }
},
{
"name": "f16_nearest_reflection_warp",
"attrs": { "mode": "nearest", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float16",
"shape": [1, 8, 28, 28],
"data": { "kind": "fillFloat32", "scale": 0.6, "sinStep": 0.13, "cosStep": 0.23 }
},
"grid": {
"dtype": "float16",
"shape": [1, 28, 28, 2],
"data": { "kind": "linspace", "start": -1.5, "end": 1.5 }
}
},
"outputs": { "y": { "dtype": "float16", "shape": [1, 8, 28, 28], "tolerance": 0.02, "relTolerance": 0.02 } }
},
{
"name": "empty_output_zero_grid_spatial_nonempty_inputs",
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 2, 3, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.7, "scale": 1.0, "offset": 0.0 }
},
"grid": {
"dtype": "float32",
"shape": [1, 0, 4, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.3, "scale": 1.0, "offset": 0.0 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 2, 0, 4] } }
},
{
"name": "linear_zeros_fold_boundary_partial_last_row_over16m",
"attrs": { "mode": "linear", "padding_mode": "zeros", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 3, 16, 16],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "scale": 1.0, "offset": 0.0 }
},
"grid": {
"dtype": "float32",
"shape": [1, 2049, 2731, 2],
"data": { "kind": "fillFloat32", "sinStep": 0.017, "scale": 0.9, "offset": 0.0 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 3, 2049, 2731] } }
},
{
"name": "cubic_reflection_channel_quad_tail_compact",
"provenance": {
"source": "ONNX GridSample-20 cubic reflection semantics",
"notes": "Exercises channel-cooperative sampling with a non-multiple-of-four channel tail and out-of-range coordinates."
},
"attrs": { "mode": "cubic", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 5, 4, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.29, "scale": 1.0 }
},
"grid": { "dtype": "float32", "shape": [1, 3, 4, 2], "data": { "kind": "linspace", "start": -1.6, "end": 1.4 } }
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 5, 3, 4], "tolerance": 0.0001, "relTolerance": 0.0001 } }
},
{
"name": "rank5_cubic_border_partition_of_unity",
"provenance": {
"notes": "A constant field: every interpolation returns the constant, so this sees only that the tricubic weights sum to one on each axis. It cannot tell cubic from linear or catch a wrong tap offset — rank5_cubic_border_pinned_taps is the case that does."
},
"attrs": { "mode": "cubic", "padding_mode": "border", "align_corners": 0 },
"inputs": {
"x": { "dtype": "float32", "shape": [1, 1, 2, 2, 2], "data": { "kind": "constant", "value": 2.0 } },
"grid": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 3],
"data": { "kind": "values", "values": [0.0, 0.0, 0.0] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 1, 1, 1, 1],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [2.0] }
}
}
},
{
"name": "rank5_cubic_border_pinned_taps",
"provenance": {
"source": "ONNX GridSample cubic definition (Keys kernel, cubic_coeff_a = -0.75), evaluated independently",
"notes": "Ground truth computed independently from the separable 4-tap definition, so neither the kernel nor the reference is its own oracle. Sample points are dyadic and the field is in quarters, so the values are exact in binary; two of the four points push taps past the volume, which border clamps. Trilinear on the same points gives different answers, so a cubic path that silently ran as linear would fail here."
},
"attrs": { "mode": "cubic", "padding_mode": "border", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 2, 4, 4, 4],
"data": {
"kind": "values",
"values": [-2.75, -2.5, -2.25, -2.0, -1.75, -1.5, -1.25, -1.0, -0.75, -0.5, -0.25, 0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, -2.75, -2.5, -2.25, -2.0, -1.75, -1.5, -1.25, -1.0, -0.75, -0.5, -0.25, 0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, -2.75, -2.5, -2.25, -2.0, -1.75, -1.5, -1.25, -1.0, -0.75, -0.5, -0.25, 0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, -2.75, -2.5, -2.25, -2.0, -1.75, -1.5, -1.25, -1.0, -0.75, -0.5, -0.25, 0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, -2.75, -2.5, -2.25, -2.0, -1.75, -1.5, -1.25, -1.0, -0.75, -0.5, -0.25, 0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, -2.75, -2.5, -2.25, -2.0, -1.75, -1.5, -1.25, -1.0, -0.75, -0.5, -0.25, 0.0, 0.25]
}
},
"grid": {
"dtype": "float32",
"shape": [1, 1, 2, 2, 3],
"data": { "kind": "values", "values": [-0.5, 0.5, 0.0, 1.0, -1.0, 0.25, 0.25, 0.75, -0.75, -0.25, 0.0, 0.5] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [1, 2, 1, 2, 2],
"tolerance": 0.00001,
"relTolerance": 0.00001,
"data": {
"kind": "values",
"values": [0.0352783203125, 0.1796875, 0.75, 0.48046875, 0.6776123046875, -1.0703125, -0.5, -1.359130859375]
}
}
}
},
{
"name": "rank5_cubic_zeros_align_corners",
"provenance": {
"notes": "Cubic with zeros padding and align_corners, so the 4-tap window reads outside the volume and must contribute nothing there. The grid scale puts roughly half the sample points out of range."
},
"attrs": { "mode": "cubic", "padding_mode": "zeros", "align_corners": 1 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 2, 5, 5, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 1.5 }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.19, "scale": 1.3 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 2, 2, 2, 2], "tolerance": 0.0001, "relTolerance": 0.0001 } }
},
{
"name": "rank5_cubic_reflection",
"provenance": {
"notes": "Cubic with reflection padding: the out-of-range taps fold back inside, which is the one padding mode whose resolved index depends on align_corners as well as the bound."
},
"attrs": { "mode": "cubic", "padding_mode": "reflection", "align_corners": 0 },
"inputs": {
"x": {
"dtype": "float32",
"shape": [1, 2, 5, 5, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.23, "cosStep": 0.41, "scale": 1.5 }
},
"grid": {
"dtype": "float32",
"shape": [1, 2, 2, 2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.19, "scale": 1.3 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [1, 2, 2, 2, 2], "tolerance": 0.0001, "relTolerance": 0.0001 } }
}
]
}