Sources/x10/xla_tensor/pooling.cpp
PoolingOpAttributes MakePoolingOpAttributes(
    absl::Span<const xla::int64> kernel_size_attr,
    absl::Span<const xla::int64> stride_attr) {
  // Create a NCHW kernel size with 1 for batch size and feature.
  std::vector<xla::int64> kernel_size(2, 1);
  kernel_size.insert(kernel_size.end(), kernel_size_attr.begin(),
                     kernel_size_attr.end());
  // Create a NCHW stride size with 1 for batch size and feature. Same as kernel
  // size if not specified.
  std::vector<xla::int64> stride;
  if (stride_attr.empty()) {
    stride = kernel_size;
  } else {
    stride.resize(2, 1);
    stride.insert(stride.end(), stride_attr.begin(), stride_attr.end());
  }
  return {kernel_size, stride};
}
// Construct the pooling attributes for the given kernel size, stride and
// padding.
Construct the pooling attributes for the given kernel size, stride and
padding.
Construct the pooling attributes for the given kernel size stride and padding .
PoolingOpAttributes MakePoolingOpAttributes(
    absl::Span<const xla::int64> kernel_size_attr,
    absl::Span<const xla::int64> stride_attr) {
  std::vector<xla::int64> kernel_size(2, 1);
  kernel_size.insert(kernel_size.end(), kernel_size_attr.begin(),
                     kernel_size_attr.end());
  std::vector<xla::int64> stride;
  if (stride_attr.empty()) {
    stride = kernel_size;
  } else {
    stride.resize(2, 1);
    stride.insert(stride.end(), stride_attr.begin(), stride_attr.end());
  }
  return {kernel_size, stride};
}
PoolingOpAttributes MakePoolingOpAttributes ( absl :: Span < const xla :: int64 > kernel_size_attr , absl :: Span < const xla :: int64 > stride_attr ) { std :: vector < xla :: int64 > kernel_size ( 2 , 1 ) ; kernel_size . insert ( kernel_size . end ( ) , kernel_size_attr . begin ( ) , kernel_size_attr . end ( ) ) ; std :: vector < xla :: int64 > stride ; if ( stride_attr . empty ( ) ) { stride = kernel_size ; } else { stride . resize ( 2 , 1 ) ; stride . insert ( stride . end ( ) , stride_attr . begin ( ) , stride_attr . end ( ) ) ; } return { kernel_size , stride } ; }
Construct the pooling attributes for the given kernel size, stride and
padding.
Construct the pooling attributes for the given kernel size stride and padding .
// Create a NCHW kernel size with 1 for batch size and feature. // Create a NCHW stride size with 1 for batch size and feature. Same as kernel // size if not specified.