Skip to content

Instantly share code, notes, and snippets.

@pashu123
Created April 25, 2023 16:12
Show Gist options
  • Save pashu123/8e2fce24870e3e896708b10c0e93c016 to your computer and use it in GitHub Desktop.
Save pashu123/8e2fce24870e3e896708b10c0e93c016 to your computer and use it in GitHub Desktop.
#loc = loc(unknown)
#map = affine_map<(d0) -> (d0)>
module attributes {torch.debug_module_name = "AtenComplexRealModule"} {
ml_program.global private mutable @global_seed(dense<0> : tensor<i64>) : tensor<i64> loc(#loc)
func.func @forward(%arg0: tensor<?xcomplex<f32>> loc(unknown)) -> tensor<?xf32> {
%c0 = arith.constant 0 : index loc(#loc)
%dim = tensor.dim %arg0, %c0 : tensor<?xcomplex<f32>> loc(#loc)
%0 = tensor.empty(%dim) : tensor<?xf32> loc(#loc)
%1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel"]} ins(%arg0 : tensor<?xcomplex<f32>>) outs(%0 : tensor<?xf32>) {
^bb0(%in: complex<f32> loc(unknown), %out: f32 loc(unknown)):
%2 = complex.re %in : complex<f32> loc(#loc)
linalg.yield %2 : f32 loc(#loc)
} -> tensor<?xf32> loc(#loc)
return %1 : tensor<?xf32> loc(#loc)
} loc(#loc)
} loc(#loc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment