Consider not constant folding ifelse false branch

Đang mở
#2,636 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
machine-learning

Hướng nghiên cứu

Start by reading this issue alongside follow-up #2606 to understand the constant-folding behavior for ifelse and the invalid false-branch example. The issue identifies lazy ifelse transformation or stack VM constant folding as possible directions, but leaves the design open. Done means defining and implementing behavior that avoids folding an invalid unselected branch, with tests demonstrating the case.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

ifelse constant folds regularly, maybe it needs a specific rewrite. Follow up to #2606

Namely I can think if an ifelse is guarding around an operation that would be invalid (like incompatible shapes in the false branch). This is tricky, because it would require some sort of early lazy ifelse transformation or use the stack vm to constant fold, either way turning inside out what is now a sequential operation (inputs are constant folded before outputs).

This is not a beginner friendly issue

Ngôn ngữ chính
Python
Star
654
Fork
258
Merge trung bình
3 ngày 41 phút
Pull request đã merge (30 ngày)
42

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pymc-devs/pytensor

Tất cả issue của pymc-devs/pytensor

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.