tensorflow/compiler/mlir/tensorflow/transforms/tpu_space_to_depth_pass.cc
// Handles stride for the first convolution for the transform.
Handles stride for the first convolution for the transform.
Handles stride for the first convolution for the transform .
void HandleConv2DStride(TF::Conv2DOp conv2d) {
  MLIRContext* context = conv2d.getContext();
  SmallVector<int64_t, 4> values = {1, 1, 1, 1};
  auto attrs = llvm::map_range(values, [context](int64_t v) -> Attribute {
    return IntegerAttr::get(IntegerType::get(context, 64), v);
  });
  auto strides = ArrayAttr::get(context, llvm::to_vector<4>(attrs));
  conv2d->setAttr("strides", strides);
}
void HandleConv2DStride ( TF :: Conv2DOp conv2d ) { MLIRContext * context = conv2d . getContext ( ) ; SmallVector < int64_t , 4 > values = { 1 , 1 , 1 , 1 } ; auto attrs = llvm :: map_range ( values , [ context ] ( int64_t v ) -> Attribute { return IntegerAttr :: get ( IntegerType :: get ( context , 64 ) , v ) ; } ) ; auto strides = ArrayAttr :: get ( context , llvm :: to_vector < 4 > ( attrs ) ) ; conv2d -> setAttr ( " " , strides ) ; }
Handles stride for the first convolution for the transform.
Handles stride for the first convolution for the transform .
// TODO(b/157276506): change type of strides to DenseElementsAttr