Skip to content

Commit

Permalink
Missing Shape Inference for Prod (#4003)
Browse files Browse the repository at this point in the history
Added required but missing Shape inference for `aten.prod`
  • Loading branch information
keshavj-cerebras authored Feb 7, 2025
1 parent d40d74f commit 52299e6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions projects/ltc/csrc/base_lazy_backend/shape_inference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,18 @@ std::vector<torch::lazy::Shape> compute_shape_native_group_norm(
return shapes;
}

std::vector<torch::lazy::Shape>
compute_shape_prod(const at::Tensor &self,
c10::optional<at::ScalarType> dtype) {
if (dtype.has_value()) {
return {Shape(dtype.value(), {})};
}
if (isIntegralType(self.scalar_type(), true)) {
return {Shape(c10::ScalarType::Long, {})};
}
return {Shape(self.scalar_type(), {})};
}

std::vector<torch::lazy::Shape>
compute_shape_im2col(const at::Tensor &self, at::IntArrayRef kernel_size,
at::IntArrayRef dilation, at::IntArrayRef padding,
Expand Down

0 comments on commit 52299e6

Please sign in to comment.