| 32 | } |
| 33 | |
| 34 | std::vector<std::pair<int64, int64>> MakeGeneralPadding( |
| 35 | XlaOp input, absl::Span<const int64> kernel_size, |
| 36 | absl::Span<const int64> stride, Padding padding, |
| 37 | const xla::TensorFormat& data_format) { |
| 38 | XlaBuilder* b = input.builder(); |
| 39 | Shape operand_shape = b->GetShape(input).ValueOrDie(); |
| 40 | std::vector<int64> input_size(operand_shape.dimensions().begin(), |
| 41 | operand_shape.dimensions().end()); |
| 42 | return MakeSpatialPadding(input_size, kernel_size, stride, padding, |
| 43 | data_format); |
| 44 | } |
| 45 | |
| 46 | // Add singleton batch and feature dimensions to spatial dimensions, according |
| 47 | // to 'data_format' specification. |
no test coverage detected