1// RUN: mlir-opt %s --test-shape-function-report -verify-diagnostics 2 3// expected-remark@+1 {{associated shape function: same_result_shape}} 4func @tanh(%arg: tensor<10x20xf32>) -> tensor<10x20xf32> 5 attributes {shape.function = @shape_lib::@same_result_shape} { 6 // expected-remark@+1 {{no associated way}} 7 %0 = tanh %arg : tensor<10x20xf32> 8 // expected-remark@+1 {{associated shape function: same_result_shape}} 9 %1 = "test.same_operand_result_type"(%0) : (tensor<10x20xf32>) -> tensor<10x20xf32> 10 return %1 : tensor<10x20xf32> 11} 12 13// The shape function library with some local functions. 14shape.function_library @shape_lib { 15 // Test shape function that returns the shape of input arg as result shape. 16 func @same_result_shape(%arg: !shape.value_shape) -> !shape.shape { 17 %0 = shape.shape_of %arg : !shape.value_shape -> !shape.shape 18 return %0 : !shape.shape 19 } 20} mapping { 21 test.same_operand_result_type = @same_result_shape 22} 23