Skip to content

Instantly share code, notes, and snippets.

@cathyzhyi
Created March 18, 2024 17:00
Show Gist options
  • Save cathyzhyi/e4995ce90b51d4e3cfc248ee15630dee to your computer and use it in GitHub Desktop.
Save cathyzhyi/e4995ce90b51d4e3cfc248ee15630dee to your computer and use it in GitHub Desktop.
func.func @mega_lib_pad_positive_3d_i32(%arg0: tensor<?x?x?xi32>, %arg1: index, %arg2: index, %arg3: index, %arg4: index, %arg5: index, %arg6: index, %arg7: i32) -> tensor<?x?x?xi32> {
%padded = tensor.pad %arg0 low[%arg1, %arg2, %arg3] high[%arg4, %arg5, %arg6] {
^bb0(%arg8: index, %arg9: index, %arg10: index):
tensor.yield %arg7 : i32
} : tensor<?x?x?xi32> to tensor<?x?x?xi32>
return %padded : tensor<?x?x?xi32>
}
func.func @mega_lib_pad_positive_2d_f32(%arg0: tensor<?x?xf32>, %arg1: index, %arg2: index, %arg3: index, %arg4: index, %arg5: f32) -> tensor<?x?xf32> {
%padded = tensor.pad %arg0 low[%arg1, %arg2] high[%arg3, %arg4] {
^bb0(%arg6: index, %arg7: index):
tensor.yield %arg5 : f32
} : tensor<?x?xf32> to tensor<?x?xf32>
return %padded : tensor<?x?xf32>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment