blob: 384832d0efb7115fa9cf54921ab1db0f323bb4ec [file] [log] [blame]
func.func @dynamic_tensor() {
%input = flow.tensor.constant dense<[[-1.0, 2.0, -3.0], [4.0, -5.0, 6.0]]> : tensor<2x3xf32> -> tensor<?x?xf32>
%res = "mhlo.abs"(%input) : (tensor<?x?xf32>) -> tensor<?x?xf32>
%dshape = util.optimization_barrier %res : tensor<?x?xf32>
%result = tensor.cast %dshape : tensor<?x?xf32> to tensor<2x3xf32>
check.expect_almost_eq_const(%result, dense<[[1.0, 2.0, 3.0],[4.0, 5.0, 6.0]]> : tensor<2x3xf32>) : tensor<2x3xf32>
return
}