tensorflow/compiler/mlir/tensorflow/transforms/tpu_space_to_depth_pass.cc
// Creates reshape op for space to depth transform.
Creates reshape op for space to depth transform.
Creates reshape op for space to depth transform .
TF::ReshapeOp GetReshapeOpForConv2DFilter(ArrayRef<int64_t> new_shape,
                                          Value input, OpBuilder* builder) {
  auto reshape_result_type =
      RankedTensorType::get(new_shape, getElementTypeOrSelf(input));
  auto reshape_type = RankedTensorType::get(
      {static_cast<int64_t>(new_shape.size())}, builder->getIntegerType(64));
  auto reshape_sizes = DenseIntElementsAttr::get(reshape_type, new_shape);
  auto reshape_value =
      builder->create<TF::ConstOp>(input.getLoc(), reshape_sizes);
  return builder->create<TF::ReshapeOp>(input.getLoc(), reshape_result_type,
                                        input, reshape_value);
}
TF :: ReshapeOp GetReshapeOpForConv2DFilter ( ArrayRef < int64_t > new_shape , Value input , OpBuilder * builder ) { auto reshape_result_type = RankedTensorType :: get ( new_shape , getElementTypeOrSelf ( input ) ) ; auto reshape_type = RankedTensorType :: get ( { static_cast < int64_t > ( new_shape . size ( ) ) } , builder -> getIntegerType ( 64 ) ) ; auto reshape_sizes = DenseIntElementsAttr :: get ( reshape_type , new_shape ) ; auto reshape_value = builder -> create < TF :: ConstOp > ( input . getLoc ( ) , reshape_sizes ) ; return builder -> create < TF :: ReshapeOp > ( input . getLoc ( ) , reshape_result_type , input , reshape_value ) ; }
Creates reshape op for space to depth transform.
Creates reshape op for space to depth transform .