Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenXLA|TSL] Replace tsl/platform/stringpiece.h with absl/strings/string_view.h #6657

Merged
merged 8 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions torch_xla/csrc/convolution_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const tsl::int32> dilations,
const std::vector<tsl::int32>& strides, Padding padding,
Expand Down Expand Up @@ -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<const tsl::int32> dilations,
const std::vector<tsl::int32>& strides, Padding padding,
Expand Down Expand Up @@ -293,7 +293,7 @@ xla::XlaOp TransposeFilterForGroupConvolutionBackpropInput(

// Wrapper for ConvGeneralDilated and check dim.
tsl::StatusOr<xla::XlaOp> 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));
Expand Down Expand Up @@ -394,7 +394,7 @@ tsl::StatusOr<xla::XlaOp> MakeXlaBackpropInputConvOp(

// Wrapper for ConvGeneralDilated and check dim.
tsl::StatusOr<xla::XlaOp> 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));
Expand Down Expand Up @@ -551,4 +551,4 @@ tsl::StatusOr<xla::XlaOp> MakeXlaBackpropFilterConvOp(

// -------------Convolution Helper Function End--------------------------

} // namespace torch_xla
} // namespace torch_xla
10 changes: 5 additions & 5 deletions torch_xla/csrc/convolution_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#define XLA_TORCH_XLA_CSRC_CONVOLUTION_HELPER_H_

#include <string>
#include <string_view>

#include "tsl/lib/gtl/inlined_vector.h"
#include "tsl/platform/stringpiece.h"
#include "xla/client/xla_builder.h"
#include "xla/xla_data.pb.h"

Expand Down Expand Up @@ -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<const tsl::int32> dilations,
const std::vector<tsl::int32>& strides, Padding padding,
Expand All @@ -246,18 +246,18 @@ tsl::Status ConvBackpropComputeDimensionsV2(

// Wrapper for ConvGeneralDilated with checking dims.
tsl::StatusOr<xla::XlaOp> 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<xla::XlaOp> 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);

// -------------Convolution Helper Function End-------------------------

} // namespace torch_xla

#endif // XLA_TORCH_XLA_CSRC_CONVOLUTION_HELPER_H_
#endif // XLA_TORCH_XLA_CSRC_CONVOLUTION_HELPER_H_
Loading