Skip to content

Commit 0ec0821

Browse files
John GibsonJohn Gibson
authored andcommitted
Remove unused function and be consistent in test logs
1 parent f3e9e27 commit 0ec0821

File tree

3 files changed

+1
-44
lines changed

3 files changed

+1
-44
lines changed

kernels/portable/cpu/util/grid_sampler_2d_util.cpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,6 @@
1212
namespace torch {
1313
namespace executor {
1414

15-
bool check_grid_sampler_2d_args(
16-
const Tensor& input,
17-
const Tensor& grid,
18-
const Tensor& out) {
19-
// Input must be 4D (N, C, H, W)
20-
ET_LOG_AND_RETURN_IF_FALSE(input.dim() == 4);
21-
ET_LOG_AND_RETURN_IF_FALSE(tensor_is_default_dim_order(input));
22-
23-
// Grid must be 4D (N, H_out, W_out, 2)
24-
ET_LOG_AND_RETURN_IF_FALSE(grid.dim() == 4);
25-
ET_LOG_AND_RETURN_IF_FALSE(grid.size(3) == 2);
26-
27-
// Output must be 4D (N, C, H_out, W_out)
28-
ET_LOG_AND_RETURN_IF_FALSE(out.dim() == 4);
29-
30-
// Batch sizes must match
31-
ET_LOG_AND_RETURN_IF_FALSE(input.size(0) == grid.size(0));
32-
ET_LOG_AND_RETURN_IF_FALSE(input.size(0) == out.size(0));
33-
34-
// Channel dimension must match between input and output
35-
ET_LOG_AND_RETURN_IF_FALSE(input.size(1) == out.size(1));
36-
37-
// Output spatial dimensions must match grid dimensions
38-
ET_LOG_AND_RETURN_IF_FALSE(out.size(2) == grid.size(1));
39-
ET_LOG_AND_RETURN_IF_FALSE(out.size(3) == grid.size(2));
40-
41-
// Input and output must have same dtype
42-
ET_LOG_AND_RETURN_IF_FALSE(tensors_have_same_dtype(input, out));
43-
44-
// Grid and input must have same dtype
45-
ET_LOG_AND_RETURN_IF_FALSE(tensors_have_same_dtype(input, grid));
46-
47-
// Output must have same dim order as input
48-
ET_LOG_AND_RETURN_IF_FALSE(tensors_have_same_dim_order(input, out));
49-
50-
return true;
51-
}
52-
5315
Error check_grid_sampler_2d_args_and_resize_out(
5416
const Tensor& input,
5517
const Tensor& grid,

kernels/portable/cpu/util/grid_sampler_2d_util.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,6 @@ inline scalar_t cubic_interp1d(
156156
return x0 * coeffs[0] + x1 * coeffs[1] + x2 * coeffs[2] + x3 * coeffs[3];
157157
}
158158

159-
// Argument checking for grid_sampler_2d
160-
bool check_grid_sampler_2d_args(
161-
const Tensor& input,
162-
const Tensor& grid,
163-
const Tensor& out);
164-
165159
// Argument checking and output tensor resizing for grid_sampler_2d
166160
Error check_grid_sampler_2d_args_and_resize_out(
167161
const Tensor& input,

kernels/portable/test/test_grid_sampler_2d_executorch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ def test_exact_boundary_coordinates(self):
376376
self.run_executorch_test(
377377
input_tensor, grid, mode, "zeros", align_corners, atol=atol
378378
)
379+
print(f" ✓ grid {i}/{mode}/align={align_corners}")
379380

380381
print("✓ Passed exact boundary coordinate tests")
381382

0 commit comments

Comments
 (0)