diff --git a/torch_xla/csrc/convolution_helper.cpp b/torch_xla/csrc/convolution_helper.cpp index 1c3545437395..584df138b5d9 100644 --- a/torch_xla/csrc/convolution_helper.cpp +++ b/torch_xla/csrc/convolution_helper.cpp @@ -144,7 +144,7 @@ tsl::Status GetWindowedOutputSizeVerboseV2( // Check dimension tsl::Status ConvBackpropExtractAndVerifyDimension( - tsl::StringPiece label, const xla::Shape& input_shape, + std::string_view label, const xla::Shape& input_shape, const xla::Shape& filter_shape, const xla::Shape& output_shape, const absl::Span dilations, const std::vector& strides, Padding padding, @@ -185,7 +185,7 @@ tsl::Status ConvBackpropExtractAndVerifyDimension( // Check dimension tsl::Status ConvBackpropComputeDimensionsV2( - tsl::StringPiece label, int num_spatial_dims, const xla::Shape& input_shape, + std::string_view label, int num_spatial_dims, const xla::Shape& input_shape, const xla::Shape& filter_shape, const xla::Shape& out_backprop_shape, absl::Span dilations, const std::vector& strides, Padding padding, @@ -293,7 +293,7 @@ xla::XlaOp TransposeFilterForGroupConvolutionBackpropInput( // Wrapper for ConvGeneralDilated and check dim. tsl::StatusOr MakeXlaBackpropInputConvOp( - tsl::StringPiece type_string, const xla::Shape& input_shape, + std::string_view type_string, const xla::Shape& input_shape, xla::XlaOp filter, xla::XlaOp out_backprop, const ConvOpAttrs& attrs, xla::XlaOp* input_sizes) { TF_RETURN_IF_ERROR(CheckConvAttrs(attrs)); @@ -394,7 +394,7 @@ tsl::StatusOr MakeXlaBackpropInputConvOp( // Wrapper for ConvGeneralDilated and check dim. tsl::StatusOr MakeXlaBackpropFilterConvOp( - tsl::StringPiece type_string, xla::XlaOp activations, + std::string_view type_string, xla::XlaOp activations, const xla::Shape& filter_shape, xla::XlaOp gradients, const ConvOpAttrs& attrs) { TF_RETURN_IF_ERROR(CheckConvAttrs(attrs)); @@ -551,4 +551,4 @@ tsl::StatusOr MakeXlaBackpropFilterConvOp( // -------------Convolution Helper Function End-------------------------- -} // namespace torch_xla \ No newline at end of file +} // namespace torch_xla diff --git a/torch_xla/csrc/convolution_helper.h b/torch_xla/csrc/convolution_helper.h index d8983d58302d..cc2f46204733 100644 --- a/torch_xla/csrc/convolution_helper.h +++ b/torch_xla/csrc/convolution_helper.h @@ -2,9 +2,9 @@ #define XLA_TORCH_XLA_CSRC_CONVOLUTION_HELPER_H_ #include +#include #include "tsl/lib/gtl/inlined_vector.h" -#include "tsl/platform/stringpiece.h" #include "xla/client/xla_builder.h" #include "xla/xla_data.pb.h" @@ -234,7 +234,7 @@ inline int GetTensorSpatialDimIndex(int num_dims, TensorFormat format, // The V2 version computes the same outputs with arbitrary dilation rate and // supports explicit padding. tsl::Status ConvBackpropComputeDimensionsV2( - tsl::StringPiece label, int num_spatial_dims, const xla::Shape& input_shape, + std::string_view label, int num_spatial_dims, const xla::Shape& input_shape, const xla::Shape& filter_shape, const xla::Shape& out_backprop_shape, absl::Span dilations, const std::vector& strides, Padding padding, @@ -246,13 +246,13 @@ tsl::Status ConvBackpropComputeDimensionsV2( // Wrapper for ConvGeneralDilated with checking dims. tsl::StatusOr MakeXlaBackpropInputConvOp( - tsl::StringPiece type_string, const xla::Shape& input_shape, + std::string_view type_string, const xla::Shape& input_shape, xla::XlaOp filter, xla::XlaOp out_backprop, const ConvOpAttrs& attrs, xla::XlaOp* input_sizes = nullptr); // Wrapper for ConvGeneralDilated with checking dims. tsl::StatusOr MakeXlaBackpropFilterConvOp( - tsl::StringPiece type_string, xla::XlaOp activations, + std::string_view type_string, xla::XlaOp activations, const xla::Shape& filter_shape, xla::XlaOp gradients, const ConvOpAttrs& attrs); @@ -260,4 +260,4 @@ tsl::StatusOr MakeXlaBackpropFilterConvOp( } // namespace torch_xla -#endif // XLA_TORCH_XLA_CSRC_CONVOLUTION_HELPER_H_ \ No newline at end of file +#endif // XLA_TORCH_XLA_CSRC_CONVOLUTION_HELPER_H_