torch-mlir/test/Dialect/Torch
Gaurav Shukla e57d3f9774 [LINALG] Fix `aten.bernoulli` op lowering
- This commit adds E2E support for `aten.rand_like` and
  `aten.bernoulli_.Tensor` ops.
- The `aten.bernoulli(x)` was implemented as:
  `aten.bernoulli(x) = rand_like(x) < 0.5`, assuming 0.5 as default
  probability, whereas according to the pytorch documentation:
  https://pytorch.org/docs/stable/generated/torch.bernoulli.html#torch.bernoulli
  the input x in `aten.bernoulli(x)` is itself a tensor containing
  probabilities to be used for drawing the binary random number.
- So this commit fixes the `aten.bernoulli(x)` implementation as:
  `aten.bernoulli(x) = rand_like(x) < x`.
- It also fixes the case where the input to `aten.bernoulli_.float` is
  an integer tensor. In this case the input must be casted to float type
  before passing it as operand to `aten.rand_like` op.
  `aten.bernoulli_.float(x, p) = rand_like(float(x)) < p`.

Signed-Off-by: Gaurav Shukla <gaurav@nod-labs.com>
2022-03-05 09:38:22 +05:30
..
GlobalizeObjectGraph Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
adjust-calling-conventions.mlir Add support for multiple return values 2021-11-16 21:07:45 -05:00
canonicalize.mlir [LINALG] Add E2E support for `aten.[Bool.Tensor|Float.Tensor]` op 2022-02-14 23:09:20 +05:30
decompose-complex-ops.mlir [LINALG] Fix `aten.bernoulli` op lowering 2022-03-05 09:38:22 +05:30
inline-global-slots.mlir Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
invalid.mlir Add operand type invariant to `torch.overwrite.tensor.contents` (#606) 2022-02-22 11:41:46 -08:00
maximize-value-semantics.mlir Add operand type invariant to `torch.overwrite.tensor.contents` (#606) 2022-02-22 11:41:46 -08:00
ops.mlir Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
prepare-for-globalize-object-graph.mlir Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
promote-types.mlir Make broadcasting result shape more static 2022-01-06 18:39:27 -05:00
reduce-op-variants-error.mlir Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
reduce-op-variants.mlir Add operand type invariant to `torch.overwrite.tensor.contents` (#606) 2022-02-22 11:41:46 -08:00
refine-public-return.mlir LLVM bump 2022-02-16 15:28:13 -05:00
refine-types-branch.mlir Move external/torch-mlir to the root of the repo. 2021-09-27 17:11:08 -07:00
refine-types.mlir Add static type information support to `aten.bmm` (#636) 2022-03-03 13:01:17 -08:00