commit | e088e5588d4db9ce9a0d397152c4c224eac37131 | [log] [tgz] |
---|---|---|
author | Lei Zhang <antiagainst@google.com> | Fri Jan 11 09:12:11 2019 -0800 |
committer | jpienaar <jpienaar@google.com> | Fri Mar 29 15:09:55 2019 -0700 |
tree | cc62fa977d0e878c06d025e2af711ff964fe11e6 | |
parent | fc860783f1cccb24b071eba0f4e6e52bd5a40c07 [diff] |
Const fold splat vectors/tensors in standard add, sub, and mul ops The const folding logic is structurally similar, so use a template to abstract the common part. Moved mul(x, 0) to a legalization pattern to be consistent with mul(x, 1). Also promoted getZeroAttr() to be a method on Builder since it is expected to be frequently used. PiperOrigin-RevId: 228891989