Skip to content

Commit

Permalink
Modify python
Browse files Browse the repository at this point in the history
  • Loading branch information
yangguohao committed Jun 17, 2022
1 parent 468847f commit c558d14
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 509 deletions.
140 changes: 0 additions & 140 deletions paddle/fluid/operators/soft_margin_loss_op.cc

This file was deleted.

40 changes: 0 additions & 40 deletions paddle/phi/infermeta/binary.cc
Expand Up @@ -1838,46 +1838,6 @@ void SigmoidCrossEntropyWithLogitsInferMeta(const MetaTensor& x,
out->share_lod(x);
}

void SoftMarginLossInferMeta(const MetaTensor& input,
const MetaTensor& label,
MetaTensor* out,
MetaConfig config) {
auto input_dims = input.dims();
auto label_dims = label.dims();

int rank = input_dims.size();
PADDLE_ENFORCE_EQ(rank,
label_dims.size(),
phi::errors::InvalidArgument(
"Input(X) and Input(Label) shall have the same rank."
"But received: the rank of Input(X) is [%d], "
"the rank of Input(Label) is [%d].",
rank,
label_dims.size()));

bool check = true;

if ((!config.is_runtime) &&
(phi::product(input_dims) <= 0 || phi::product(label_dims) <= 0)) {
check = false;
}

if (check) {
PADDLE_ENFORCE_EQ(input_dims,
label_dims,
phi::errors::InvalidArgument(
"Input(X) and Input(Label) shall have the same "
"shape. But received: the shape of Input(X) is "
"[%s], the shape of Input(Label) is [%s].",
input_dims,
label_dims));
}

out->set_dims(input_dims);
out->set_dtype(input.dtype());
out->share_lod(input);
}

void TakeAlongAxisInferMeta(const MetaTensor& x,
const MetaTensor& index,
int axis,
Expand Down
5 changes: 0 additions & 5 deletions paddle/phi/infermeta/binary.h
Expand Up @@ -270,11 +270,6 @@ void SigmoidCrossEntropyWithLogitsInferMeta(const MetaTensor& x,
MetaTensor* out,
MetaConfig config = MetaConfig());

void SoftMarginLossInferMeta(const MetaTensor& input,
const MetaTensor& label,
MetaTensor* out,
MetaConfig config = MetaConfig());

void TakeAlongAxisInferMeta(const MetaTensor& x,
const MetaTensor& index,
int axis,
Expand Down
51 changes: 0 additions & 51 deletions paddle/phi/kernels/cpu/soft_margin_loss_grad_kernel.cc

This file was deleted.

46 changes: 0 additions & 46 deletions paddle/phi/kernels/cpu/soft_margin_loss_kernel.cc

This file was deleted.

62 changes: 0 additions & 62 deletions paddle/phi/kernels/gpu/soft_margin_loss_grad_kernel.cu

This file was deleted.

0 comments on commit c558d14

Please sign in to comment.