Created
July 30, 2018 18:28
-
-
Save dan-zheng/4956b4e57b6e6a5ab76cf456ad5a822b to your computer and use it in GitHub Desktop.
Max pooling produces send/recv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%24 = graph_op "MaxPoolV2,i,i,i"(%4 : $TensorHandle<Float>, %14 : $TensorHandle<Int32>, %22 : $TensorHandle<Int32>) {T: $Float, padding: "SAME", data_format: "NHWC", __device: "/device:CPU:0"} : $TensorHandle<Float> | |
As you can see, kernel size and strides are SSA operands of `graph_op`, not constant attributes. | |
This is because of how MaxPool is defined: | |
REGISTER_OP("MaxPoolV2") | |
.Attr( | |
"T: {half, bfloat16, float, double, int32, int64, uint8, int16, int8, " | |
"uint16, qint8} = DT_FLOAT") | |
.Attr(GetPaddingAttrString()) | |
.Attr("data_format: {'NHWC', 'NCHW', 'NCHW_VECT_C'} = 'NHWC'") | |
.Input("input: T") | |
.Input("ksize: int32") | |
.Input("strides: int32") | |
.Output("output: T") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import TensorFlow | |
func test() { | |
let x = Tensor<Float>(ones: [2, 2, 2, 2]) | |
let pooled = x.maxPooled( | |
kernelSize: (1, 2, 2, 1), strides: (1, 2, 2, 1), padding: .same | |
) | |
} | |
test() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ swiftc -Xllvm -tf-dump-intermediates -O ~/swift-models/max-pool.swift | |
/Users/danielzheng/swift-models/max-pool.swift:4:7: warning: initialization of immutable value 'pooled' was never used; consider replacing with assignment to '_' or removing it | |
let pooled = x.maxPooled( | |
~~~~^~~~~~ | |
_ | |
--- TFDeabstraction Input: $S4main4testyyF | |
// test() | |
sil hidden @$S4main4testyyF : $@convention(thin) () -> () { | |
bb0: | |
%0 = metatype $@thin Tensor<Float>.Type // user: %31 | |
%1 = metatype $@thin TensorShape.Type // user: %29 | |
%2 = integer_literal $Builtin.Word, 4 // user: %4 | |
// function_ref _allocateUninitializedArray<A>(_:) | |
%3 = function_ref @$Ss27_allocateUninitializedArrayySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %4 | |
%4 = apply %3<Int32>(%2) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %8, %5, %7 | |
%5 = tuple_extract %4 : $(Array<Int32>, Builtin.RawPointer), 0 // users: %29, %6 | |
retain_value %5 : $Array<Int32> // id: %6 | |
%7 = tuple_extract %4 : $(Array<Int32>, Builtin.RawPointer), 1 // user: %9 | |
release_value %4 : $(Array<Int32>, Builtin.RawPointer) // id: %8 | |
%9 = pointer_to_address %7 : $Builtin.RawPointer to [strict] $*Int32 // users: %12, %24, %19, %14 | |
%10 = integer_literal $Builtin.Int32, 2 // user: %11 | |
%11 = struct $Int32 (%10 : $Builtin.Int32) // user: %12 | |
store %11 to %9 : $*Int32 // id: %12 | |
%13 = integer_literal $Builtin.Word, 1 // user: %14 | |
%14 = index_addr %9 : $*Int32, %13 : $Builtin.Word // user: %17 | |
%15 = integer_literal $Builtin.Int32, 2 // user: %16 | |
%16 = struct $Int32 (%15 : $Builtin.Int32) // user: %17 | |
store %16 to %14 : $*Int32 // id: %17 | |
%18 = integer_literal $Builtin.Word, 2 // user: %19 | |
%19 = index_addr %9 : $*Int32, %18 : $Builtin.Word // user: %22 | |
%20 = integer_literal $Builtin.Int32, 2 // user: %21 | |
%21 = struct $Int32 (%20 : $Builtin.Int32) // user: %22 | |
store %21 to %19 : $*Int32 // id: %22 | |
%23 = integer_literal $Builtin.Word, 3 // user: %24 | |
%24 = index_addr %9 : $*Int32, %23 : $Builtin.Word // user: %27 | |
%25 = integer_literal $Builtin.Int32, 2 // user: %26 | |
%26 = struct $Int32 (%25 : $Builtin.Int32) // user: %27 | |
store %26 to %24 : $*Int32 // id: %27 | |
// function_ref TensorShape.init(arrayLiteral:) | |
%28 = function_ref @$S10TensorFlow0A5ShapeV12arrayLiteralACs5Int32Vd_tcfC : $@convention(method) (@owned Array<Int32>, @thin TensorShape.Type) -> @owned TensorShape // user: %29 | |
%29 = apply %28(%5, %1) : $@convention(method) (@owned Array<Int32>, @thin TensorShape.Type) -> @owned TensorShape // user: %31 | |
// function_ref Tensor<>.init(ones:) | |
%30 = function_ref @$S10TensorFlow0A0VAASjRzrlE4onesACyxGAA0A5ShapeV_tcfC : $@convention(method) <τ_0_0 where τ_0_0 : Numeric, τ_0_0 : AccelerableByTensorFlow> (@owned TensorShape, @thin Tensor<τ_0_0>.Type) -> @owned Tensor<τ_0_0> // user: %31 | |
%31 = apply %30<Float>(%29, %0) : $@convention(method) <τ_0_0 where τ_0_0 : Numeric, τ_0_0 : AccelerableByTensorFlow> (@owned TensorShape, @thin Tensor<τ_0_0>.Type) -> @owned Tensor<τ_0_0> // users: %55, %52, %32 | |
debug_value %31 : $Tensor<Float>, let, name "x" // id: %32 | |
%33 = integer_literal $Builtin.Int32, 1 // user: %34 | |
%34 = struct $Int32 (%33 : $Builtin.Int32) // user: %52 | |
%35 = integer_literal $Builtin.Int32, 2 // user: %36 | |
%36 = struct $Int32 (%35 : $Builtin.Int32) // user: %52 | |
%37 = integer_literal $Builtin.Int32, 2 // user: %38 | |
%38 = struct $Int32 (%37 : $Builtin.Int32) // user: %52 | |
%39 = integer_literal $Builtin.Int32, 1 // user: %40 | |
%40 = struct $Int32 (%39 : $Builtin.Int32) // user: %52 | |
%41 = integer_literal $Builtin.Int32, 1 // user: %42 | |
%42 = struct $Int32 (%41 : $Builtin.Int32) // user: %52 | |
%43 = integer_literal $Builtin.Int32, 2 // user: %44 | |
%44 = struct $Int32 (%43 : $Builtin.Int32) // user: %52 | |
%45 = integer_literal $Builtin.Int32, 2 // user: %46 | |
%46 = struct $Int32 (%45 : $Builtin.Int32) // user: %52 | |
%47 = integer_literal $Builtin.Int32, 1 // user: %48 | |
%48 = struct $Int32 (%47 : $Builtin.Int32) // user: %52 | |
%49 = metatype $@thin Padding.Type | |
%50 = enum $Padding, #Padding.same!enumelt // user: %52 | |
// function_ref Tensor<>.maxPooled(kernelSize:strides:padding:) | |
%51 = function_ref @$S10TensorFlow0A0VAASBRzrlE9maxPooled10kernelSize7strides7paddingACyxGs5Int32V_A3Jt_AJ_A3JtAA7PaddingOtF : $@convention(method) <τ_0_0 where τ_0_0 : BinaryFloatingPoint, τ_0_0 : AccelerableByTensorFlow> (Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Padding, @guaranteed Tensor<τ_0_0>) -> @owned Tensor<τ_0_0> // user: %52 | |
%52 = apply %51<Float>(%34, %36, %38, %40, %42, %44, %46, %48, %50, %31) : $@convention(method) <τ_0_0 where τ_0_0 : BinaryFloatingPoint, τ_0_0 : AccelerableByTensorFlow> (Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Padding, @guaranteed Tensor<τ_0_0>) -> @owned Tensor<τ_0_0> // users: %54, %53 | |
debug_value %52 : $Tensor<Float>, let, name "pooled" // id: %53 | |
release_value %52 : $Tensor<Float> // id: %54 | |
release_value %31 : $Tensor<Float> // id: %55 | |
%56 = tuple () // user: %57 | |
return %56 : $() // id: %57 | |
} // end sil function '$S4main4testyyF' | |
---- | |
--- TFDeabstraction Result: $S4main4testyyF | |
// test() | |
sil hidden @$S4main4testyyF : $@convention(thin) () -> () { | |
bb0: | |
%0 = metatype $@thin TensorShape.Type // user: %28 | |
%1 = integer_literal $Builtin.Word, 4 // user: %3 | |
// function_ref _allocateUninitializedArray<A>(_:) | |
%2 = function_ref @$Ss27_allocateUninitializedArrayySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %3 | |
%3 = apply %2<Int32>(%1) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %7, %4, %6 | |
%4 = tuple_extract %3 : $(Array<Int32>, Builtin.RawPointer), 0 // users: %28, %5 | |
retain_value %4 : $Array<Int32> // id: %5 | |
%6 = tuple_extract %3 : $(Array<Int32>, Builtin.RawPointer), 1 // user: %8 | |
release_value %3 : $(Array<Int32>, Builtin.RawPointer) // id: %7 | |
%8 = pointer_to_address %6 : $Builtin.RawPointer to [strict] $*Int32 // users: %11, %23, %18, %13 | |
%9 = integer_literal $Builtin.Int32, 2 // user: %10 | |
%10 = struct $Int32 (%9 : $Builtin.Int32) // user: %11 | |
store %10 to %8 : $*Int32 // id: %11 | |
%12 = integer_literal $Builtin.Word, 1 // user: %13 | |
%13 = index_addr %8 : $*Int32, %12 : $Builtin.Word // user: %16 | |
%14 = integer_literal $Builtin.Int32, 2 // user: %15 | |
%15 = struct $Int32 (%14 : $Builtin.Int32) // user: %16 | |
store %15 to %13 : $*Int32 // id: %16 | |
%17 = integer_literal $Builtin.Word, 2 // user: %18 | |
%18 = index_addr %8 : $*Int32, %17 : $Builtin.Word // user: %21 | |
%19 = integer_literal $Builtin.Int32, 2 // user: %20 | |
%20 = struct $Int32 (%19 : $Builtin.Int32) // user: %21 | |
store %20 to %18 : $*Int32 // id: %21 | |
%22 = integer_literal $Builtin.Word, 3 // user: %23 | |
%23 = index_addr %8 : $*Int32, %22 : $Builtin.Word // user: %26 | |
%24 = integer_literal $Builtin.Int32, 2 // user: %25 | |
%25 = struct $Int32 (%24 : $Builtin.Int32) // user: %26 | |
store %25 to %23 : $*Int32 // id: %26 | |
// function_ref TensorShape.init(arrayLiteral:) | |
%27 = function_ref @$S10TensorFlow0A5ShapeV12arrayLiteralACs5Int32Vd_tcfC : $@convention(method) (@owned Array<Int32>, @thin TensorShape.Type) -> @owned TensorShape // user: %28 | |
%28 = apply %27(%4, %0) : $@convention(method) (@owned Array<Int32>, @thin TensorShape.Type) -> @owned TensorShape // users: %89, %85, %40, %29 | |
retain_value %28 : $TensorShape // id: %29 | |
%30 = alloc_stack $Float // users: %54, %38, %87 | |
%31 = metatype $@thick Float.Type // user: %38 | |
%32 = alloc_stack $Int64 // users: %38, %36, %39 | |
%33 = metatype $@thick Int64.Type // user: %36 | |
%34 = integer_literal $Builtin.Int2048, 1 // user: %36 | |
// function_ref protocol witness for _ExpressibleByBuiltinIntegerLiteral.init(_builtinIntegerLiteral:) in conformance Int64 | |
%35 = function_ref @$Ss5Int64Vs35_ExpressibleByBuiltinIntegerLiteralssACP08_builtineF0xBi2048__tcfCTW : $@convention(witness_method: _ExpressibleByBuiltinIntegerLiteral) (Builtin.Int2048, @thick Int64.Type) -> @out Int64 // user: %36 | |
%36 = apply %35(%32, %34, %33) : $@convention(witness_method: _ExpressibleByBuiltinIntegerLiteral) (Builtin.Int2048, @thick Int64.Type) -> @out Int64 | |
// function_ref protocol witness for ExpressibleByIntegerLiteral.init(integerLiteral:) in conformance Float | |
%37 = function_ref @$SSfs27ExpressibleByIntegerLiteralssAAP07integerD0x0cD4TypeQz_tcfCTW : $@convention(witness_method: ExpressibleByIntegerLiteral) (@in Int64, @thick Float.Type) -> @out Float // user: %38 | |
%38 = apply %37(%30, %32, %31) : $@convention(witness_method: ExpressibleByIntegerLiteral) (@in Int64, @thick Float.Type) -> @out Float | |
dealloc_stack %32 : $*Int64 // id: %39 | |
%40 = struct_extract %28 : $TensorShape, #TensorShape.dimensions // users: %52, %41 | |
retain_value %40 : $Array<Int32> // id: %41 | |
%42 = graph_op "Const"() {dtype: $Int32, value$tensor: [$Int32: (i32 2), (i32 2), (i32 2), (i32 2)], value$shape: [$Int32: i32 4], __device: "/device:CPU:0"} : $TensorHandle<Int32> // users: %69, %45, %46, %51, %53, %67, %71, %83 | |
%43 = alloc_stack $Tensor<Int32> // users: %44, %47, %50 | |
%44 = struct_element_addr %43 : $*Tensor<Int32>, #Tensor.handle // user: %45 | |
store %42 to %44 : $*TensorHandle<Int32> // id: %45 | |
strong_retain %42 : $TensorHandle<Int32> // id: %46 | |
%47 = load %43 : $*Tensor<Int32> // user: %48 | |
%48 = struct_extract %47 : $Tensor<Int32>, #Tensor.handle // user: %49 | |
strong_release %48 : $TensorHandle<Int32> // id: %49 | |
dealloc_stack %43 : $*Tensor<Int32> // id: %50 | |
strong_retain %42 : $TensorHandle<Int32> // id: %51 | |
release_value %40 : $Array<Int32> // id: %52 | |
strong_release %42 : $TensorHandle<Int32> // id: %53 | |
%54 = load %30 : $*Float // user: %55 | |
%55 = struct_extract %54 : $Float, #Float._value // user: %56 | |
%56 = graph_op "tfc.scalarToTensor,s"(%55 : $Builtin.FPIEEE32) {__device: "/device:CPU:0"} : $TensorHandle<Float> // users: %69, %59, %60, %65, %66, %68, %70, %82 | |
%57 = alloc_stack $Tensor<Float> // users: %58, %61, %64 | |
%58 = struct_element_addr %57 : $*Tensor<Float>, #Tensor.handle // user: %59 | |
store %56 to %58 : $*TensorHandle<Float> // id: %59 | |
strong_retain %56 : $TensorHandle<Float> // id: %60 | |
%61 = load %57 : $*Tensor<Float> // user: %62 | |
%62 = struct_extract %61 : $Tensor<Float>, #Tensor.handle // user: %63 | |
strong_release %62 : $TensorHandle<Float> // id: %63 | |
dealloc_stack %57 : $*Tensor<Float> // id: %64 | |
strong_retain %56 : $TensorHandle<Float> // id: %65 | |
strong_release %56 : $TensorHandle<Float> // id: %66 | |
strong_retain %42 : $TensorHandle<Int32> // id: %67 | |
strong_retain %56 : $TensorHandle<Float> // id: %68 | |
%69 = graph_op "Fill,i,i"(%42 : $TensorHandle<Int32>, %56 : $TensorHandle<Float>) {T: $Float, index_type: $Int32, __device: "/device:CPU:0"} : $TensorHandle<Float> // users: %385, %75, %72, %76, %81, %84, %86, %88, %90, %378, %390, %404 | |
strong_release %56 : $TensorHandle<Float> // id: %70 | |
strong_release %42 : $TensorHandle<Int32> // id: %71 | |
strong_retain %69 : $TensorHandle<Float> // id: %72 | |
%73 = alloc_stack $Tensor<Float> // users: %74, %77, %80 | |
%74 = struct_element_addr %73 : $*Tensor<Float>, #Tensor.handle // user: %75 | |
store %69 to %74 : $*TensorHandle<Float> // id: %75 | |
strong_retain %69 : $TensorHandle<Float> // id: %76 | |
%77 = load %73 : $*Tensor<Float> // user: %78 | |
%78 = struct_extract %77 : $Tensor<Float>, #Tensor.handle // user: %79 | |
strong_release %78 : $TensorHandle<Float> // id: %79 | |
dealloc_stack %73 : $*Tensor<Float> // id: %80 | |
strong_release %69 : $TensorHandle<Float> // id: %81 | |
strong_release %56 : $TensorHandle<Float> // id: %82 | |
strong_release %42 : $TensorHandle<Int32> // id: %83 | |
strong_retain %69 : $TensorHandle<Float> // id: %84 | |
release_value %28 : $TensorShape // id: %85 | |
strong_release %69 : $TensorHandle<Float> // id: %86 | |
dealloc_stack %30 : $*Float // id: %87 | |
strong_retain %69 : $TensorHandle<Float> // id: %88 | |
release_value %28 : $TensorShape // id: %89 | |
strong_release %69 : $TensorHandle<Float> // id: %90 | |
%91 = integer_literal $Builtin.Int32, 1 // user: %92 | |
%92 = struct $Int32 (%91 : $Builtin.Int32) // user: %108 | |
%93 = integer_literal $Builtin.Int32, 2 // user: %94 | |
%94 = struct $Int32 (%93 : $Builtin.Int32) // user: %108 | |
%95 = integer_literal $Builtin.Int32, 2 // user: %96 | |
%96 = struct $Int32 (%95 : $Builtin.Int32) // user: %108 | |
%97 = integer_literal $Builtin.Int32, 1 // user: %98 | |
%98 = struct $Int32 (%97 : $Builtin.Int32) // user: %108 | |
%99 = integer_literal $Builtin.Int32, 1 // user: %100 | |
%100 = struct $Int32 (%99 : $Builtin.Int32) // user: %109 | |
%101 = integer_literal $Builtin.Int32, 2 // user: %102 | |
%102 = struct $Int32 (%101 : $Builtin.Int32) // user: %109 | |
%103 = integer_literal $Builtin.Int32, 2 // user: %104 | |
%104 = struct $Int32 (%103 : $Builtin.Int32) // user: %109 | |
%105 = integer_literal $Builtin.Int32, 1 // user: %106 | |
%106 = struct $Int32 (%105 : $Builtin.Int32) // user: %109 | |
%107 = enum $Padding, #Padding.same!enumelt // user: %375 | |
%108 = tuple (%92 : $Int32, %94 : $Int32, %96 : $Int32, %98 : $Int32) // users: %113, %112, %111, %110 | |
%109 = tuple (%100 : $Int32, %102 : $Int32, %104 : $Int32, %106 : $Int32) // users: %245, %244, %243, %242 | |
%110 = tuple_extract %108 : $(Int32, Int32, Int32, Int32), 0 // user: %115 | |
%111 = tuple_extract %108 : $(Int32, Int32, Int32, Int32), 1 // user: %117 | |
%112 = tuple_extract %108 : $(Int32, Int32, Int32, Int32), 2 // user: %119 | |
%113 = tuple_extract %108 : $(Int32, Int32, Int32, Int32), 3 // user: %121 | |
%114 = alloc_stack $Int32 // users: %241, %128, %115 | |
store %110 to %114 : $*Int32 // id: %115 | |
%116 = alloc_stack $Int32 // users: %240, %130, %117 | |
store %111 to %116 : $*Int32 // id: %117 | |
%118 = alloc_stack $Int32 // users: %239, %132, %119 | |
store %112 to %118 : $*Int32 // id: %119 | |
%120 = alloc_stack $Int32 // users: %238, %134, %121 | |
store %113 to %120 : $*Int32 // id: %121 | |
%122 = alloc_stack $(Int32, Int32, Int32, Int32) // users: %236, %235, %133, %131, %129, %127, %126, %125, %124, %123 | |
%123 = tuple_element_addr %122 : $*(Int32, Int32, Int32, Int32), 0 // users: %196, %180, %164, %148 | |
%124 = tuple_element_addr %122 : $*(Int32, Int32, Int32, Int32), 1 // users: %197, %181, %165, %149 | |
%125 = tuple_element_addr %122 : $*(Int32, Int32, Int32, Int32), 2 // users: %198, %182, %166, %150 | |
%126 = tuple_element_addr %122 : $*(Int32, Int32, Int32, Int32), 3 // users: %199, %183, %167, %151 | |
%127 = tuple_element_addr %122 : $*(Int32, Int32, Int32, Int32), 0 // user: %128 | |
copy_addr [take] %114 to [initialization] %127 : $*Int32 // id: %128 | |
%129 = tuple_element_addr %122 : $*(Int32, Int32, Int32, Int32), 1 // user: %130 | |
copy_addr [take] %116 to [initialization] %129 : $*Int32 // id: %130 | |
%131 = tuple_element_addr %122 : $*(Int32, Int32, Int32, Int32), 2 // user: %132 | |
copy_addr [take] %118 to [initialization] %131 : $*Int32 // id: %132 | |
%133 = tuple_element_addr %122 : $*(Int32, Int32, Int32, Int32), 3 // user: %134 | |
copy_addr [take] %120 to [initialization] %133 : $*Int32 // id: %134 | |
%135 = integer_literal $Builtin.Word, 4 // user: %137 | |
// function_ref _allocateUninitializedArray<A>(_:) | |
%136 = function_ref @$Ss27_allocateUninitializedArrayySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %137 | |
%137 = apply %136<Int32>(%135) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %141, %140, %138 | |
%138 = tuple_extract %137 : $(Array<Int32>, Builtin.RawPointer), 0 // users: %222, %232, %139 | |
retain_value %138 : $Array<Int32> // id: %139 | |
%140 = tuple_extract %137 : $(Array<Int32>, Builtin.RawPointer), 1 // user: %142 | |
release_value %137 : $(Array<Int32>, Builtin.RawPointer) // id: %141 | |
%142 = pointer_to_address %140 : $Builtin.RawPointer to [strict] $*Int32 // users: %190, %174, %158, %156 | |
%143 = alloc_stack $(Int32, Int32, Int32, Int32) // users: %220, %155, %154, %153, %152, %147, %146, %145, %144 | |
%144 = tuple_element_addr %143 : $*(Int32, Int32, Int32, Int32), 0 // user: %148 | |
%145 = tuple_element_addr %143 : $*(Int32, Int32, Int32, Int32), 1 // user: %149 | |
%146 = tuple_element_addr %143 : $*(Int32, Int32, Int32, Int32), 2 // user: %150 | |
%147 = tuple_element_addr %143 : $*(Int32, Int32, Int32, Int32), 3 // user: %151 | |
copy_addr %123 to [initialization] %144 : $*Int32 // id: %148 | |
copy_addr %124 to [initialization] %145 : $*Int32 // id: %149 | |
copy_addr %125 to [initialization] %146 : $*Int32 // id: %150 | |
copy_addr %126 to [initialization] %147 : $*Int32 // id: %151 | |
%152 = tuple_element_addr %143 : $*(Int32, Int32, Int32, Int32), 0 // user: %156 | |
%153 = tuple_element_addr %143 : $*(Int32, Int32, Int32, Int32), 1 // user: %219 | |
%154 = tuple_element_addr %143 : $*(Int32, Int32, Int32, Int32), 2 // user: %218 | |
%155 = tuple_element_addr %143 : $*(Int32, Int32, Int32, Int32), 3 // user: %217 | |
copy_addr [take] %152 to [initialization] %142 : $*Int32 // id: %156 | |
%157 = integer_literal $Builtin.Word, 1 // user: %158 | |
%158 = index_addr %142 : $*Int32, %157 : $Builtin.Word // user: %172 | |
%159 = alloc_stack $(Int32, Int32, Int32, Int32) // users: %216, %171, %170, %169, %168, %163, %162, %161, %160 | |
%160 = tuple_element_addr %159 : $*(Int32, Int32, Int32, Int32), 0 // user: %164 | |
%161 = tuple_element_addr %159 : $*(Int32, Int32, Int32, Int32), 1 // user: %165 | |
%162 = tuple_element_addr %159 : $*(Int32, Int32, Int32, Int32), 2 // user: %166 | |
%163 = tuple_element_addr %159 : $*(Int32, Int32, Int32, Int32), 3 // user: %167 | |
copy_addr %123 to [initialization] %160 : $*Int32 // id: %164 | |
copy_addr %124 to [initialization] %161 : $*Int32 // id: %165 | |
copy_addr %125 to [initialization] %162 : $*Int32 // id: %166 | |
copy_addr %126 to [initialization] %163 : $*Int32 // id: %167 | |
%168 = tuple_element_addr %159 : $*(Int32, Int32, Int32, Int32), 0 // user: %215 | |
%169 = tuple_element_addr %159 : $*(Int32, Int32, Int32, Int32), 1 // user: %172 | |
%170 = tuple_element_addr %159 : $*(Int32, Int32, Int32, Int32), 2 // user: %214 | |
%171 = tuple_element_addr %159 : $*(Int32, Int32, Int32, Int32), 3 // user: %213 | |
copy_addr [take] %169 to [initialization] %158 : $*Int32 // id: %172 | |
%173 = integer_literal $Builtin.Word, 2 // user: %174 | |
%174 = index_addr %142 : $*Int32, %173 : $Builtin.Word // user: %188 | |
%175 = alloc_stack $(Int32, Int32, Int32, Int32) // users: %212, %187, %186, %185, %184, %179, %178, %177, %176 | |
%176 = tuple_element_addr %175 : $*(Int32, Int32, Int32, Int32), 0 // user: %180 | |
%177 = tuple_element_addr %175 : $*(Int32, Int32, Int32, Int32), 1 // user: %181 | |
%178 = tuple_element_addr %175 : $*(Int32, Int32, Int32, Int32), 2 // user: %182 | |
%179 = tuple_element_addr %175 : $*(Int32, Int32, Int32, Int32), 3 // user: %183 | |
copy_addr %123 to [initialization] %176 : $*Int32 // id: %180 | |
copy_addr %124 to [initialization] %177 : $*Int32 // id: %181 | |
copy_addr %125 to [initialization] %178 : $*Int32 // id: %182 | |
copy_addr %126 to [initialization] %179 : $*Int32 // id: %183 | |
%184 = tuple_element_addr %175 : $*(Int32, Int32, Int32, Int32), 0 // user: %211 | |
%185 = tuple_element_addr %175 : $*(Int32, Int32, Int32, Int32), 1 // user: %210 | |
%186 = tuple_element_addr %175 : $*(Int32, Int32, Int32, Int32), 2 // user: %188 | |
%187 = tuple_element_addr %175 : $*(Int32, Int32, Int32, Int32), 3 // user: %209 | |
copy_addr [take] %186 to [initialization] %174 : $*Int32 // id: %188 | |
%189 = integer_literal $Builtin.Word, 3 // user: %190 | |
%190 = index_addr %142 : $*Int32, %189 : $Builtin.Word // user: %204 | |
%191 = alloc_stack $(Int32, Int32, Int32, Int32) // users: %208, %203, %202, %201, %200, %195, %194, %193, %192 | |
%192 = tuple_element_addr %191 : $*(Int32, Int32, Int32, Int32), 0 // user: %196 | |
%193 = tuple_element_addr %191 : $*(Int32, Int32, Int32, Int32), 1 // user: %197 | |
%194 = tuple_element_addr %191 : $*(Int32, Int32, Int32, Int32), 2 // user: %198 | |
%195 = tuple_element_addr %191 : $*(Int32, Int32, Int32, Int32), 3 // user: %199 | |
copy_addr %123 to [initialization] %192 : $*Int32 // id: %196 | |
copy_addr %124 to [initialization] %193 : $*Int32 // id: %197 | |
copy_addr %125 to [initialization] %194 : $*Int32 // id: %198 | |
copy_addr %126 to [initialization] %195 : $*Int32 // id: %199 | |
%200 = tuple_element_addr %191 : $*(Int32, Int32, Int32, Int32), 0 // user: %207 | |
%201 = tuple_element_addr %191 : $*(Int32, Int32, Int32, Int32), 1 // user: %206 | |
%202 = tuple_element_addr %191 : $*(Int32, Int32, Int32, Int32), 2 // user: %205 | |
%203 = tuple_element_addr %191 : $*(Int32, Int32, Int32, Int32), 3 // user: %204 | |
copy_addr [take] %203 to [initialization] %190 : $*Int32 // id: %204 | |
destroy_addr %202 : $*Int32 // id: %205 | |
destroy_addr %201 : $*Int32 // id: %206 | |
destroy_addr %200 : $*Int32 // id: %207 | |
dealloc_stack %191 : $*(Int32, Int32, Int32, Int32) // id: %208 | |
destroy_addr %187 : $*Int32 // id: %209 | |
destroy_addr %185 : $*Int32 // id: %210 | |
destroy_addr %184 : $*Int32 // id: %211 | |
dealloc_stack %175 : $*(Int32, Int32, Int32, Int32) // id: %212 | |
destroy_addr %171 : $*Int32 // id: %213 | |
destroy_addr %170 : $*Int32 // id: %214 | |
destroy_addr %168 : $*Int32 // id: %215 | |
dealloc_stack %159 : $*(Int32, Int32, Int32, Int32) // id: %216 | |
destroy_addr %155 : $*Int32 // id: %217 | |
destroy_addr %154 : $*Int32 // id: %218 | |
destroy_addr %153 : $*Int32 // id: %219 | |
dealloc_stack %143 : $*(Int32, Int32, Int32, Int32) // id: %220 | |
// function_ref __tf_tensor_from_scalars_1d | |
%221 = function_ref @__tf_tensor_from_scalars_1d : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // user: %222 | |
%222 = apply %221<Int32>(%138) : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %385, %402, %389, %379, %237, %234, %233, %231, %226, %225 | |
%223 = alloc_stack $Tensor<Int32> // users: %224, %227, %230 | |
%224 = struct_element_addr %223 : $*Tensor<Int32>, #Tensor.handle // user: %225 | |
store %222 to %224 : $*TensorHandle<Int32> // id: %225 | |
strong_retain %222 : $TensorHandle<Int32> // id: %226 | |
%227 = load %223 : $*Tensor<Int32> // user: %228 | |
%228 = struct_extract %227 : $Tensor<Int32>, #Tensor.handle // user: %229 | |
strong_release %228 : $TensorHandle<Int32> // id: %229 | |
dealloc_stack %223 : $*Tensor<Int32> // id: %230 | |
strong_retain %222 : $TensorHandle<Int32> // id: %231 | |
release_value %138 : $Array<Int32> // id: %232 | |
strong_release %222 : $TensorHandle<Int32> // id: %233 | |
strong_retain %222 : $TensorHandle<Int32> // id: %234 | |
destroy_addr %122 : $*(Int32, Int32, Int32, Int32) // id: %235 | |
dealloc_stack %122 : $*(Int32, Int32, Int32, Int32) // id: %236 | |
strong_release %222 : $TensorHandle<Int32> // id: %237 | |
dealloc_stack %120 : $*Int32 // id: %238 | |
dealloc_stack %118 : $*Int32 // id: %239 | |
dealloc_stack %116 : $*Int32 // id: %240 | |
dealloc_stack %114 : $*Int32 // id: %241 | |
%242 = tuple_extract %109 : $(Int32, Int32, Int32, Int32), 0 // user: %247 | |
%243 = tuple_extract %109 : $(Int32, Int32, Int32, Int32), 1 // user: %249 | |
%244 = tuple_extract %109 : $(Int32, Int32, Int32, Int32), 2 // user: %251 | |
%245 = tuple_extract %109 : $(Int32, Int32, Int32, Int32), 3 // user: %253 | |
%246 = alloc_stack $Int32 // users: %373, %260, %247 | |
store %242 to %246 : $*Int32 // id: %247 | |
%248 = alloc_stack $Int32 // users: %372, %262, %249 | |
store %243 to %248 : $*Int32 // id: %249 | |
%250 = alloc_stack $Int32 // users: %371, %264, %251 | |
store %244 to %250 : $*Int32 // id: %251 | |
%252 = alloc_stack $Int32 // users: %370, %266, %253 | |
store %245 to %252 : $*Int32 // id: %253 | |
%254 = alloc_stack $(Int32, Int32, Int32, Int32) // users: %368, %367, %265, %263, %261, %259, %258, %257, %256, %255 | |
%255 = tuple_element_addr %254 : $*(Int32, Int32, Int32, Int32), 0 // users: %328, %312, %296, %280 | |
%256 = tuple_element_addr %254 : $*(Int32, Int32, Int32, Int32), 1 // users: %329, %313, %297, %281 | |
%257 = tuple_element_addr %254 : $*(Int32, Int32, Int32, Int32), 2 // users: %330, %314, %298, %282 | |
%258 = tuple_element_addr %254 : $*(Int32, Int32, Int32, Int32), 3 // users: %331, %315, %299, %283 | |
%259 = tuple_element_addr %254 : $*(Int32, Int32, Int32, Int32), 0 // user: %260 | |
copy_addr [take] %246 to [initialization] %259 : $*Int32 // id: %260 | |
%261 = tuple_element_addr %254 : $*(Int32, Int32, Int32, Int32), 1 // user: %262 | |
copy_addr [take] %248 to [initialization] %261 : $*Int32 // id: %262 | |
%263 = tuple_element_addr %254 : $*(Int32, Int32, Int32, Int32), 2 // user: %264 | |
copy_addr [take] %250 to [initialization] %263 : $*Int32 // id: %264 | |
%265 = tuple_element_addr %254 : $*(Int32, Int32, Int32, Int32), 3 // user: %266 | |
copy_addr [take] %252 to [initialization] %265 : $*Int32 // id: %266 | |
%267 = integer_literal $Builtin.Word, 4 // user: %269 | |
// function_ref _allocateUninitializedArray<A>(_:) | |
%268 = function_ref @$Ss27_allocateUninitializedArrayySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %269 | |
%269 = apply %268<Int32>(%267) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // users: %273, %272, %270 | |
%270 = tuple_extract %269 : $(Array<Int32>, Builtin.RawPointer), 0 // users: %354, %364, %271 | |
retain_value %270 : $Array<Int32> // id: %271 | |
%272 = tuple_extract %269 : $(Array<Int32>, Builtin.RawPointer), 1 // user: %274 | |
release_value %269 : $(Array<Int32>, Builtin.RawPointer) // id: %273 | |
%274 = pointer_to_address %272 : $Builtin.RawPointer to [strict] $*Int32 // users: %322, %306, %290, %288 | |
%275 = alloc_stack $(Int32, Int32, Int32, Int32) // users: %352, %287, %286, %285, %284, %279, %278, %277, %276 | |
%276 = tuple_element_addr %275 : $*(Int32, Int32, Int32, Int32), 0 // user: %280 | |
%277 = tuple_element_addr %275 : $*(Int32, Int32, Int32, Int32), 1 // user: %281 | |
%278 = tuple_element_addr %275 : $*(Int32, Int32, Int32, Int32), 2 // user: %282 | |
%279 = tuple_element_addr %275 : $*(Int32, Int32, Int32, Int32), 3 // user: %283 | |
copy_addr %255 to [initialization] %276 : $*Int32 // id: %280 | |
copy_addr %256 to [initialization] %277 : $*Int32 // id: %281 | |
copy_addr %257 to [initialization] %278 : $*Int32 // id: %282 | |
copy_addr %258 to [initialization] %279 : $*Int32 // id: %283 | |
%284 = tuple_element_addr %275 : $*(Int32, Int32, Int32, Int32), 0 // user: %288 | |
%285 = tuple_element_addr %275 : $*(Int32, Int32, Int32, Int32), 1 // user: %351 | |
%286 = tuple_element_addr %275 : $*(Int32, Int32, Int32, Int32), 2 // user: %350 | |
%287 = tuple_element_addr %275 : $*(Int32, Int32, Int32, Int32), 3 // user: %349 | |
copy_addr [take] %284 to [initialization] %274 : $*Int32 // id: %288 | |
%289 = integer_literal $Builtin.Word, 1 // user: %290 | |
%290 = index_addr %274 : $*Int32, %289 : $Builtin.Word // user: %304 | |
%291 = alloc_stack $(Int32, Int32, Int32, Int32) // users: %348, %303, %302, %301, %300, %295, %294, %293, %292 | |
%292 = tuple_element_addr %291 : $*(Int32, Int32, Int32, Int32), 0 // user: %296 | |
%293 = tuple_element_addr %291 : $*(Int32, Int32, Int32, Int32), 1 // user: %297 | |
%294 = tuple_element_addr %291 : $*(Int32, Int32, Int32, Int32), 2 // user: %298 | |
%295 = tuple_element_addr %291 : $*(Int32, Int32, Int32, Int32), 3 // user: %299 | |
copy_addr %255 to [initialization] %292 : $*Int32 // id: %296 | |
copy_addr %256 to [initialization] %293 : $*Int32 // id: %297 | |
copy_addr %257 to [initialization] %294 : $*Int32 // id: %298 | |
copy_addr %258 to [initialization] %295 : $*Int32 // id: %299 | |
%300 = tuple_element_addr %291 : $*(Int32, Int32, Int32, Int32), 0 // user: %347 | |
%301 = tuple_element_addr %291 : $*(Int32, Int32, Int32, Int32), 1 // user: %304 | |
%302 = tuple_element_addr %291 : $*(Int32, Int32, Int32, Int32), 2 // user: %346 | |
%303 = tuple_element_addr %291 : $*(Int32, Int32, Int32, Int32), 3 // user: %345 | |
copy_addr [take] %301 to [initialization] %290 : $*Int32 // id: %304 | |
%305 = integer_literal $Builtin.Word, 2 // user: %306 | |
%306 = index_addr %274 : $*Int32, %305 : $Builtin.Word // user: %320 | |
%307 = alloc_stack $(Int32, Int32, Int32, Int32) // users: %344, %319, %318, %317, %316, %311, %310, %309, %308 | |
%308 = tuple_element_addr %307 : $*(Int32, Int32, Int32, Int32), 0 // user: %312 | |
%309 = tuple_element_addr %307 : $*(Int32, Int32, Int32, Int32), 1 // user: %313 | |
%310 = tuple_element_addr %307 : $*(Int32, Int32, Int32, Int32), 2 // user: %314 | |
%311 = tuple_element_addr %307 : $*(Int32, Int32, Int32, Int32), 3 // user: %315 | |
copy_addr %255 to [initialization] %308 : $*Int32 // id: %312 | |
copy_addr %256 to [initialization] %309 : $*Int32 // id: %313 | |
copy_addr %257 to [initialization] %310 : $*Int32 // id: %314 | |
copy_addr %258 to [initialization] %311 : $*Int32 // id: %315 | |
%316 = tuple_element_addr %307 : $*(Int32, Int32, Int32, Int32), 0 // user: %343 | |
%317 = tuple_element_addr %307 : $*(Int32, Int32, Int32, Int32), 1 // user: %342 | |
%318 = tuple_element_addr %307 : $*(Int32, Int32, Int32, Int32), 2 // user: %320 | |
%319 = tuple_element_addr %307 : $*(Int32, Int32, Int32, Int32), 3 // user: %341 | |
copy_addr [take] %318 to [initialization] %306 : $*Int32 // id: %320 | |
%321 = integer_literal $Builtin.Word, 3 // user: %322 | |
%322 = index_addr %274 : $*Int32, %321 : $Builtin.Word // user: %336 | |
%323 = alloc_stack $(Int32, Int32, Int32, Int32) // users: %340, %335, %334, %333, %332, %327, %326, %325, %324 | |
%324 = tuple_element_addr %323 : $*(Int32, Int32, Int32, Int32), 0 // user: %328 | |
%325 = tuple_element_addr %323 : $*(Int32, Int32, Int32, Int32), 1 // user: %329 | |
%326 = tuple_element_addr %323 : $*(Int32, Int32, Int32, Int32), 2 // user: %330 | |
%327 = tuple_element_addr %323 : $*(Int32, Int32, Int32, Int32), 3 // user: %331 | |
copy_addr %255 to [initialization] %324 : $*Int32 // id: %328 | |
copy_addr %256 to [initialization] %325 : $*Int32 // id: %329 | |
copy_addr %257 to [initialization] %326 : $*Int32 // id: %330 | |
copy_addr %258 to [initialization] %327 : $*Int32 // id: %331 | |
%332 = tuple_element_addr %323 : $*(Int32, Int32, Int32, Int32), 0 // user: %339 | |
%333 = tuple_element_addr %323 : $*(Int32, Int32, Int32, Int32), 1 // user: %338 | |
%334 = tuple_element_addr %323 : $*(Int32, Int32, Int32, Int32), 2 // user: %337 | |
%335 = tuple_element_addr %323 : $*(Int32, Int32, Int32, Int32), 3 // user: %336 | |
copy_addr [take] %335 to [initialization] %322 : $*Int32 // id: %336 | |
destroy_addr %334 : $*Int32 // id: %337 | |
destroy_addr %333 : $*Int32 // id: %338 | |
destroy_addr %332 : $*Int32 // id: %339 | |
dealloc_stack %323 : $*(Int32, Int32, Int32, Int32) // id: %340 | |
destroy_addr %319 : $*Int32 // id: %341 | |
destroy_addr %317 : $*Int32 // id: %342 | |
destroy_addr %316 : $*Int32 // id: %343 | |
dealloc_stack %307 : $*(Int32, Int32, Int32, Int32) // id: %344 | |
destroy_addr %303 : $*Int32 // id: %345 | |
destroy_addr %302 : $*Int32 // id: %346 | |
destroy_addr %300 : $*Int32 // id: %347 | |
dealloc_stack %291 : $*(Int32, Int32, Int32, Int32) // id: %348 | |
destroy_addr %287 : $*Int32 // id: %349 | |
destroy_addr %286 : $*Int32 // id: %350 | |
destroy_addr %285 : $*Int32 // id: %351 | |
dealloc_stack %275 : $*(Int32, Int32, Int32, Int32) // id: %352 | |
// function_ref __tf_tensor_from_scalars_1d | |
%353 = function_ref @__tf_tensor_from_scalars_1d : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // user: %354 | |
%354 = apply %353<Int32>(%270) : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %385, %401, %388, %380, %369, %366, %365, %363, %358, %357 | |
%355 = alloc_stack $Tensor<Int32> // users: %356, %359, %362 | |
%356 = struct_element_addr %355 : $*Tensor<Int32>, #Tensor.handle // user: %357 | |
store %354 to %356 : $*TensorHandle<Int32> // id: %357 | |
strong_retain %354 : $TensorHandle<Int32> // id: %358 | |
%359 = load %355 : $*Tensor<Int32> // user: %360 | |
%360 = struct_extract %359 : $Tensor<Int32>, #Tensor.handle // user: %361 | |
strong_release %360 : $TensorHandle<Int32> // id: %361 | |
dealloc_stack %355 : $*Tensor<Int32> // id: %362 | |
strong_retain %354 : $TensorHandle<Int32> // id: %363 | |
release_value %270 : $Array<Int32> // id: %364 | |
strong_release %354 : $TensorHandle<Int32> // id: %365 | |
strong_retain %354 : $TensorHandle<Int32> // id: %366 | |
destroy_addr %254 : $*(Int32, Int32, Int32, Int32) // id: %367 | |
dealloc_stack %254 : $*(Int32, Int32, Int32, Int32) // id: %368 | |
strong_release %354 : $TensorHandle<Int32> // id: %369 | |
dealloc_stack %252 : $*Int32 // id: %370 | |
dealloc_stack %250 : $*Int32 // id: %371 | |
dealloc_stack %248 : $*Int32 // id: %372 | |
dealloc_stack %246 : $*Int32 // id: %373 | |
// function_ref Padding.raw.getter | |
%374 = function_ref @$S10TensorFlow7PaddingO3rawAA3RawOABOvg : $@convention(method) (Padding) -> Raw.Padding // user: %375 | |
%375 = apply %374(%107) : $@convention(method) (Padding) -> Raw.Padding // user: %382 | |
// function_ref default argument 4 of static Raw.maxPoolV2<A>(_:ksize:strides:padding:dataFormat:) | |
%376 = function_ref @$S10TensorFlow3RawO9maxPoolV2_5ksize7strides7padding10dataFormatAA0A0VyxGAK_AJys5Int32VGAnC7PaddingOAC11DataFormat3OtSjRzAA013AccelerableByaB0RzlFZfA3_ : $@convention(thin) <τ_0_0 where τ_0_0 : Numeric, τ_0_0 : AccelerableByTensorFlow> () -> Raw.DataFormat3 // user: %377 | |
%377 = apply %376<Float>() : $@convention(thin) <τ_0_0 where τ_0_0 : Numeric, τ_0_0 : AccelerableByTensorFlow> () -> Raw.DataFormat3 // user: %384 | |
strong_retain %69 : $TensorHandle<Float> // id: %378 | |
strong_retain %222 : $TensorHandle<Int32> // id: %379 | |
strong_retain %354 : $TensorHandle<Int32> // id: %380 | |
// function_ref Raw.Padding.cName.getter | |
%381 = function_ref @$S10TensorFlow3RawO7PaddingO5cNameSSvg : $@convention(method) (Raw.Padding) -> @owned String // user: %382 | |
%382 = apply %381(%375) : $@convention(method) (Raw.Padding) -> @owned String // user: %387 | |
// function_ref Raw.DataFormat3.cName.getter | |
%383 = function_ref @$S10TensorFlow3RawO11DataFormat3O5cNameSSvg : $@convention(method) (Raw.DataFormat3) -> @owned String // user: %384 | |
%384 = apply %383(%377) : $@convention(method) (Raw.DataFormat3) -> @owned String // user: %386 | |
%385 = graph_op "MaxPoolV2,i,i,i"(%69 : $TensorHandle<Float>, %222 : $TensorHandle<Int32>, %354 : $TensorHandle<Int32>) {T: $Float, padding: "SAME", data_format: "NHWC", __device: "/device:CPU:0"} : $TensorHandle<Float> // users: %394, %391, %395, %400, %403 | |
release_value %384 : $String // id: %386 | |
release_value %382 : $String // id: %387 | |
strong_release %354 : $TensorHandle<Int32> // id: %388 | |
strong_release %222 : $TensorHandle<Int32> // id: %389 | |
strong_release %69 : $TensorHandle<Float> // id: %390 | |
strong_retain %385 : $TensorHandle<Float> // id: %391 | |
%392 = alloc_stack $Tensor<Float> // users: %393, %396, %399 | |
%393 = struct_element_addr %392 : $*Tensor<Float>, #Tensor.handle // user: %394 | |
store %385 to %393 : $*TensorHandle<Float> // id: %394 | |
strong_retain %385 : $TensorHandle<Float> // id: %395 | |
%396 = load %392 : $*Tensor<Float> // user: %397 | |
%397 = struct_extract %396 : $Tensor<Float>, #Tensor.handle // user: %398 | |
strong_release %397 : $TensorHandle<Float> // id: %398 | |
dealloc_stack %392 : $*Tensor<Float> // id: %399 | |
strong_release %385 : $TensorHandle<Float> // id: %400 | |
strong_release %354 : $TensorHandle<Int32> // id: %401 | |
strong_release %222 : $TensorHandle<Int32> // id: %402 | |
strong_release %385 : $TensorHandle<Float> // id: %403 | |
strong_release %69 : $TensorHandle<Float> // id: %404 | |
%405 = tuple () // user: %406 | |
return %405 : $() // id: %406 | |
} // end sil function '$S4main4testyyF' | |
---- | |
---- INPUT FUNCTION $S4main4testyyF ---------- | |
// test() | |
sil hidden @$S4main4testyyF : $@convention(thin) () -> () { | |
bb0: | |
%0 = integer_literal $Builtin.Int64, 1 // user: %1 | |
%1 = builtin "sitofp_Int64_FPIEEE32"(%0 : $Builtin.Int64) : $Builtin.FPIEEE32 // user: %3 | |
%2 = graph_op "Const"() {dtype: $Int32, value$tensor: [$Int32: (i32 2), (i32 2), (i32 2), (i32 2)], value$shape: [$Int32: i32 4], __device: "/device:CPU:0"} : $TensorHandle<Int32> // users: %6, %4 | |
%3 = graph_op "tfc.scalarToTensor,s"(%1 : $Builtin.FPIEEE32) {__device: "/device:CPU:0"} : $TensorHandle<Float> // users: %5, %4 | |
%4 = graph_op "Fill,i,i"(%2 : $TensorHandle<Int32>, %3 : $TensorHandle<Float>) {T: $Float, index_type: $Int32, __device: "/device:CPU:0"} : $TensorHandle<Float> // users: %28, %24 | |
strong_release %3 : $TensorHandle<Float> // id: %5 | |
strong_release %2 : $TensorHandle<Int32> // id: %6 | |
%7 = global_value @$S4main4testyyFTv_ : $_ContiguousArrayStorage<Int32> // users: %15, %9, %8 | |
strong_retain %7 : $_ContiguousArrayStorage<Int32> // id: %8 | |
%9 = unchecked_ref_cast %7 : $_ContiguousArrayStorage<Int32> to $Builtin.BridgeObject // user: %10 | |
%10 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%9 : $Builtin.BridgeObject) // user: %11 | |
%11 = struct $_ArrayBuffer<Int32> (%10 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %12 | |
%12 = struct $Array<Int32> (%11 : $_ArrayBuffer<Int32>) // user: %14 | |
// function_ref __tf_tensor_from_scalars_1d | |
%13 = function_ref @__tf_tensor_from_scalars_1d : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %22, %14 | |
%14 = apply %13<Int32>(%12) : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %26, %24 | |
strong_release %7 : $_ContiguousArrayStorage<Int32> // id: %15 | |
%16 = global_value @$S4main4testyyFTv0_ : $_ContiguousArrayStorage<Int32> // users: %23, %18, %17 | |
strong_retain %16 : $_ContiguousArrayStorage<Int32> // id: %17 | |
%18 = unchecked_ref_cast %16 : $_ContiguousArrayStorage<Int32> to $Builtin.BridgeObject // user: %19 | |
%19 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%18 : $Builtin.BridgeObject) // user: %20 | |
%20 = struct $_ArrayBuffer<Int32> (%19 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %21 | |
%21 = struct $Array<Int32> (%20 : $_ArrayBuffer<Int32>) // user: %22 | |
%22 = apply %13<Int32>(%21) : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %25, %24 | |
strong_release %16 : $_ContiguousArrayStorage<Int32> // id: %23 | |
%24 = graph_op "MaxPoolV2,i,i,i"(%4 : $TensorHandle<Float>, %14 : $TensorHandle<Int32>, %22 : $TensorHandle<Int32>) {T: $Float, padding: "SAME", data_format: "NHWC", __device: "/device:CPU:0"} : $TensorHandle<Float> // user: %27 | |
strong_release %22 : $TensorHandle<Int32> // id: %25 | |
strong_release %14 : $TensorHandle<Int32> // id: %26 | |
strong_release %24 : $TensorHandle<Float> // id: %27 | |
strong_release %4 : $TensorHandle<Float> // id: %28 | |
%29 = tuple () // user: %30 | |
return %29 : $() // id: %30 | |
} // end sil function '$S4main4testyyF' | |
---- END OF INPUT FUNCTION ---------- | |
IMPLICIT COPY TO ACCEL OF: %14 = apply %13<Int32>(%12) : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %26, %24 | |
IMPLICIT COPY TO ACCEL BY: %24 = graph_op "MaxPoolV2,i,i,i"(%4 : $TensorHandle<Float>, %14 : $TensorHandle<Int32>, %22 : $TensorHandle<Int32>) {T: $Float, padding: "SAME", data_format: "NHWC", __device: "/device:CPU:0"} : $TensorHandle<Float> // user: %27 | |
/Users/danielzheng/swift-models/max-pool.swift:4:18: warning: method result implicitly copied to the accelerator, use .toAccelerator() to make transfer explicit | |
let pooled = x.maxPooled( | |
~~^~~~~~~~~~ | |
IMPLICIT COPY TO ACCEL OF: %22 = apply %13<Int32>(%21) : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %25, %24 | |
IMPLICIT COPY TO ACCEL BY: %24 = graph_op "MaxPoolV2,i,i,i"(%4 : $TensorHandle<Float>, %14 : $TensorHandle<Int32>, %22 : $TensorHandle<Int32>) {T: $Float, padding: "SAME", data_format: "NHWC", __device: "/device:CPU:0"} : $TensorHandle<Float> // user: %27 | |
/Users/danielzheng/swift-models/max-pool.swift:4:18: warning: method result implicitly copied to the accelerator, use .toAccelerator() to make transfer explicit | |
let pooled = x.maxPooled( | |
~~^~~~~~~~~~ | |
---- ANALYSIS STATE FOR FUNCTION $S4main4testyyF ---------- | |
Tensor start point: %0 = integer_literal $Builtin.Int64, 1 // user: %1 | |
Tensor end point: strong_release %22 : $TensorHandle<Int32> // id: %25 | |
SIL with markings: | |
bb0: | |
[Move] %0 = integer_literal $Builtin.Int64, 1 // user: %1 | |
[Move] %1 = builtin "sitofp_Int64_FPIEEE32"(%0 : $Builtin.Int64) : $Builtin.FPIEEE32 // user: %3 | |
[Move] %2 = graph_op "Const"() {dtype: $Int32, value$tensor: [$Int32: (i32 2), (i32 2), (i32 2), (i32 2)], value$shape: [$Int32: i32 4], __device: "/device:CPU:0"} : $TensorHandle<Int32> // users: %6, %4 | |
[Move] %3 = graph_op "tfc.scalarToTensor,s"(%1 : $Builtin.FPIEEE32) {__device: "/device:CPU:0"} : $TensorHandle<Float> // users: %5, %4 | |
[Move] %4 = graph_op "Fill,i,i"(%2 : $TensorHandle<Int32>, %3 : $TensorHandle<Float>) {T: $Float, index_type: $Int32, __device: "/device:CPU:0"} : $TensorHandle<Float> // users: %28, %24 | |
strong_release %3 : $TensorHandle<Float> // id: %5 | |
strong_release %2 : $TensorHandle<Int32> // id: %6 | |
%7 = global_value @$S4main4testyyFTv_ : $_ContiguousArrayStorage<Int32> // users: %15, %9, %8 | |
strong_retain %7 : $_ContiguousArrayStorage<Int32> // id: %8 | |
%9 = unchecked_ref_cast %7 : $_ContiguousArrayStorage<Int32> to $Builtin.BridgeObject // user: %10 | |
%10 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%9 : $Builtin.BridgeObject) // user: %11 | |
%11 = struct $_ArrayBuffer<Int32> (%10 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %12 | |
%12 = struct $Array<Int32> (%11 : $_ArrayBuffer<Int32>) // user: %14 | |
// function_ref __tf_tensor_from_scalars_1d | |
%13 = function_ref @__tf_tensor_from_scalars_1d : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %22, %14 | |
[Send] %14 = apply %13<Int32>(%12) : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %26, %24 | |
strong_release %7 : $_ContiguousArrayStorage<Int32> // id: %15 | |
%16 = global_value @$S4main4testyyFTv0_ : $_ContiguousArrayStorage<Int32> // users: %23, %18, %17 | |
strong_retain %16 : $_ContiguousArrayStorage<Int32> // id: %17 | |
%18 = unchecked_ref_cast %16 : $_ContiguousArrayStorage<Int32> to $Builtin.BridgeObject // user: %19 | |
%19 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%18 : $Builtin.BridgeObject) // user: %20 | |
%20 = struct $_ArrayBuffer<Int32> (%19 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %21 | |
%21 = struct $Array<Int32> (%20 : $_ArrayBuffer<Int32>) // user: %22 | |
[Send] %22 = apply %13<Int32>(%21) : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %25, %24 | |
strong_release %16 : $_ContiguousArrayStorage<Int32> // id: %23 | |
[Move] %24 = graph_op "MaxPoolV2,i,i,i"(%4 : $TensorHandle<Float>, %14 : $TensorHandle<Int32>, %22 : $TensorHandle<Int32>) {T: $Float, padding: "SAME", data_format: "NHWC", __device: "/device:CPU:0"} : $TensorHandle<Float> // user: %27 | |
strong_release %22 : $TensorHandle<Int32> // id: %25 | |
strong_release %14 : $TensorHandle<Int32> // id: %26 | |
strong_release %24 : $TensorHandle<Float> // id: %27 | |
strong_release %4 : $TensorHandle<Float> // id: %28 | |
%29 = tuple () // user: %30 | |
return %29 : $() // id: %30 | |
---- END OF ANALYSIS STATE FOR FUNCTION ---------- | |
---- PARTITION STATE FOR FUNCTION $S4main4testyyF ---------- | |
(Possibly updated) tensor end point: strong_release %22 : $TensorHandle<Int32> // id: %25 | |
There are 0 result values: | |
---- END OF PARTITION STATE FOR FUNCTION ---------- | |
--- TFPartition Accelerator Result: $S4main4testyyF.tf | |
// test() | |
sil private @$S4main4testyyF.tf : $@callee_owned () -> () { | |
bb0: | |
%0 = graph_op "Const"() {dtype$dtype: $Builtin.Int64, value$tensor: i64 1, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.Int64> // user: %1 | |
%1 = graph_op "Cast,i"(%0 : $TensorHandle<Builtin.Int64>) {DstT$dtype: $Builtin.FPIEEE32, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %3 | |
%2 = graph_op "Const"() {dtype: $Int32, value$tensor: [$Int32: (i32 2), (i32 2), (i32 2), (i32 2)], value$shape: [$Int32: i32 4], __device: "/device:CPU:0"} : $TensorHandle<Int32> // user: %4 | |
%3 = unchecked_ref_cast %1 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %4 | |
%4 = graph_op "Fill,i,i"(%2 : $TensorHandle<Int32>, %3 : $TensorHandle<Float>) {T: $Float, index_type: $Int32, __device: "/device:CPU:0"} : $TensorHandle<Float> // user: %7 | |
%5 = graph_op "tfc.RecvFromHost"() {tensorId: i32 0, __device: "/device:CPU:0"} : $TensorHandle<Int32> // user: %7 | |
%6 = graph_op "tfc.RecvFromHost"() {tensorId: i32 1, __device: "/device:CPU:0"} : $TensorHandle<Int32> // user: %7 | |
%7 = graph_op "MaxPoolV2,i,i,i"(%4 : $TensorHandle<Float>, %5 : $TensorHandle<Int32>, %6 : $TensorHandle<Int32>) {T: $Float, padding: "SAME", data_format: "NHWC", __device: "/device:CPU:0"} : $TensorHandle<Float> | |
%8 = tuple () // user: %9 | |
return %8 : $() // id: %9 | |
} // end sil function '$S4main4testyyF.tf' | |
---- | |
--- XLA CFG Canonicalize: $S4main4testyyF.tf | |
block bb0 | |
--- XLA CFG Canonicalize end | |
---- | |
--- TFDevicePartition Cross Device Tensor Transfer Annotation Result: $S4main4testyyF.tf | |
// test() | |
sil private @$S4main4testyyF.tf : $@callee_owned () -> () { | |
bb0: | |
%0 = graph_op "Const"() {dtype$dtype: $Builtin.Int64, value$tensor: i64 1, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.Int64> // user: %1 | |
%1 = graph_op "Cast,i"(%0 : $TensorHandle<Builtin.Int64>) {DstT$dtype: $Builtin.FPIEEE32, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %3 | |
%2 = graph_op "Const"() {dtype: $Int32, value$tensor: [$Int32: (i32 2), (i32 2), (i32 2), (i32 2)], value$shape: [$Int32: i32 4], __device: "/device:CPU:0"} : $TensorHandle<Int32> // user: %4 | |
%3 = unchecked_ref_cast %1 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %4 | |
%4 = graph_op "Fill,i,i"(%2 : $TensorHandle<Int32>, %3 : $TensorHandle<Float>) {T: $Float, index_type: $Int32, __device: "/device:CPU:0"} : $TensorHandle<Float> // user: %7 | |
%5 = graph_op "tfc.RecvFromHost"() {tensorId: i32 0, __device: "/device:CPU:0"} : $TensorHandle<Int32> // user: %7 | |
%6 = graph_op "tfc.RecvFromHost"() {tensorId: i32 1, __device: "/device:CPU:0"} : $TensorHandle<Int32> // user: %7 | |
%7 = graph_op "MaxPoolV2,i,i,i"(%4 : $TensorHandle<Float>, %5 : $TensorHandle<Int32>, %6 : $TensorHandle<Int32>) {T: $Float, padding: "SAME", data_format: "NHWC", __device: "/device:CPU:0"} : $TensorHandle<Float> | |
%8 = tuple () // user: %9 | |
return %8 : $() // id: %9 | |
} // end sil function '$S4main4testyyF.tf' | |
---- | |
--- TFDevicePartition Per-Device Function Extraction Result: $S4main4testyyF.tf_CPU.device_partition | |
// test() | |
sil private @$S4main4testyyF.tf_CPU.device_partition : $@callee_owned () -> () { | |
bb0: | |
%0 = graph_op "Const"() {dtype$dtype: $Builtin.Int64, value$tensor: i64 1, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.Int64> // user: %1 | |
%1 = graph_op "Cast,i"(%0 : $TensorHandle<Builtin.Int64>) {DstT$dtype: $Builtin.FPIEEE32, __device: "ALL_DEVICES"} : $TensorHandle<Builtin.FPIEEE32> // user: %3 | |
%2 = graph_op "Const"() {dtype: $Int32, value$tensor: [$Int32: (i32 2), (i32 2), (i32 2), (i32 2)], value$shape: [$Int32: i32 4], __device: "/device:CPU:0"} : $TensorHandle<Int32> // user: %4 | |
%3 = unchecked_ref_cast %1 : $TensorHandle<Builtin.FPIEEE32> to $TensorHandle<Float> // user: %4 | |
%4 = graph_op "Fill,i,i"(%2 : $TensorHandle<Int32>, %3 : $TensorHandle<Float>) {T: $Float, index_type: $Int32, __device: "/device:CPU:0"} : $TensorHandle<Float> // user: %7 | |
%5 = graph_op "tfc.RecvFromHost"() {tensorId: i32 0, __device: "/device:CPU:0"} : $TensorHandle<Int32> // user: %7 | |
%6 = graph_op "tfc.RecvFromHost"() {tensorId: i32 1, __device: "/device:CPU:0"} : $TensorHandle<Int32> // user: %7 | |
%7 = graph_op "MaxPoolV2,i,i,i"(%4 : $TensorHandle<Float>, %5 : $TensorHandle<Int32>, %6 : $TensorHandle<Int32>) {T: $Float, padding: "SAME", data_format: "NHWC", __device: "/device:CPU:0"} : $TensorHandle<Float> | |
%8 = tuple () // user: %9 | |
return %8 : $() // id: %9 | |
} // end sil function '$S4main4testyyF.tf_CPU.device_partition' | |
---- | |
--- TFPartition Host Result: $S4main4testyyF | |
// test() | |
sil hidden @$S4main4testyyF : $@convention(thin) () -> () { | |
bb0: | |
%0 = string_literal bytes "0A92010A0C6669666F5F71756575655F30120B4649464F51756575655632220D2F6465766963653A4350553A302A0C0A0673686170657312020A002A1D0A0B7368617265645F6E616D65120E120C6669666F5F71756575655F302A0E0A086361706163697479120218012A0F0A09636F6E7461696E6572120212002A180A0F636F6D706F6E656E745F747970657312050A033201030A3F0A146172675F74656E736F725F656E71756575655F30120B506C616365686F6C6465722A0B0A056474797065120230032A0D0A05736861706512043A0218010A8A010A146669666F5F71756575655F656E71756575655F30120E5175657565456E717565756556321A0C6669666F5F71756575655F301A146172675F74656E736F725F656E71756575655F30220D2F6465766963653A4350553A302A190A0A74696D656F75745F6D73120B18FFFFFFFFFFFFFFFFFF012A140A0B54636F6D706F6E656E747312050A033201030A92010A0C6669666F5F71756575655F31120B4649464F51756575655632220D2F6465766963653A4350553A302A0E0A086361706163697479120218012A0F0A09636F6E7461696E6572120212002A180A0F636F6D706F6E656E745F747970657312050A033201032A0C0A0673686170657312020A002A1D0A0B7368617265645F6E616D65120E120C6669666F5F71756575655F310A3F0A146172675F74656E736F725F656E71756575655F31120B506C616365686F6C6465722A0B0A056474797065120230032A0D0A05736861706512043A0218010A8A010A146669666F5F71756575655F656E71756575655F31120E5175657565456E717565756556321A0C6669666F5F71756575655F311A146172675F74656E736F725F656E71756575655F31220D2F6465766963653A4350553A302A190A0A74696D656F75745F6D73120B18FFFFFFFFFFFFFFFFFF012A140A0B54636F6D706F6E656E747312050A033201030A530A1A7466635F66756E635F53346D61696E34746573747979462E7466122653346D61696E34746573747979462E74665F4350552E6465766963655F706172746974696F6E220D2F6465766963653A4350553A3012830A0A800A0A2B0A2653346D61696E34746573747979462E74665F4350552E6465766963655F706172746974696F6E8801011A540A1B6F702F746573742E2E2E322E365F2F6465766963655F4350555F301205436F6E7374220D2F6465766963653A4350553A302A120A0576616C756512094207080912005201012A0B0A056474797065120230091A720A1D6F702F746573742E2E5F312E322E365F2F6465766963655F4350555F301204436173741A246F702F746573742E2E2E322E365F2F6465766963655F4350555F303A6F75747075743A30220D2F6465766963653A4350553A302A0A0A0444737454120230012A0A0A0453726354120230091A690A1D6F702F746573742E2E5F322E322E365F2F6465766963655F4350555F301205436F6E7374220D2F6465766963653A4350553A302A0B0A056474797065120230032A250A0576616C7565121C421A08031204120208042210020000000200000002000000020000001A8D010A106F705F2F6465766963655F4350555F30120446696C6C1A266F702F746573742E2E5F322E322E365F2F6465766963655F4350555F303A6F75747075743A301A216F702F746573742E2E5F312E322E365F2F6465766963655F4350555F303A793A30220D2F6465766963653A4350553A302A070A0154120230012A100A0A696E6465785F74797065120230031A92010A0C6669666F5F71756575655F30120B4649464F51756575655632220D2F6465766963653A4350553A302A0E0A086361706163697479120218012A180A0F636F6D706F6E656E745F747970657312050A033201032A0F0A09636F6E7461696E6572120212002A0C0A0673686170657312020A002A1D0A0B7368617265645F6E616D65120E120C6669666F5F71756575655F301A81010A146669666F5F71756575655F646571756575655F30120E51756575654465717565756556321A156669666F5F71756575655F303A68616E646C653A30220D2F6465766963653A4350553A302A180A0F636F6D706F6E656E745F747970657312050A033201032A190A0A74696D656F75745F6D73120B18FFFFFFFFFFFFFFFFFF011A92010A0C6669666F5F71756575655F31120B4649464F51756575655632220D2F6465766963653A4350553A302A1D0A0B7368617265645F6E616D65120E120C6669666F5F71756575655F312A0E0A086361706163697479120218012A180A0F636F6D706F6E656E745F747970657312050A033201032A0F0A09636F6E7461696E6572120212002A0C0A0673686170657312020A001A98010A146669666F5F71756575655F646571756575655F31120E51756575654465717565756556321A156669666F5F71756575655F313A68616E646C653A301A155E6669666F5F71756575655F646571756575655F30220D2F6465766963653A4350553A302A180A0F636F6D706F6E656E745F747970657312050A033201032A190A0A74696D656F75745F6D73120B18FFFFFFFFFFFFFFFFFF011AC2010A126F705F2F6465766963655F4350555F305F3012094D6178506F6F6C56321A196F705F2F6465766963655F4350555F303A6F75747075743A301A216669666F5F71756575655F646571756575655F303A636F6D706F6E656E74733A301A216669666F5F71756575655F646571756575655F313A636F6D706F6E656E74733A30220D2F6465766963653A4350553A302A110A0770616464696E671206120453414D452A070A0154120230012A150A0B646174615F666F726D6174120612044E4857432204081A100C" // user: %4 | |
%1 = integer_literal $Builtin.Int64, 2087 // user: %6 | |
%2 = string_literal utf8 "S4main4testyyF.tf" // user: %5 | |
%3 = integer_literal $Builtin.Int64, 0 // user: %7 | |
%4 = struct $UnsafeRawPointer (%0 : $Builtin.RawPointer) // user: %17 | |
%5 = struct $UnsafePointer<Int8> (%2 : $Builtin.RawPointer) // user: %17 | |
%6 = struct $Int (%1 : $Builtin.Int64) // user: %17 | |
%7 = struct $Int (%3 : $Builtin.Int64) // user: %17 | |
%8 = alloc_stack $OpaquePointer // users: %19, %9 | |
%9 = begin_access [read] [static] %8 : $*OpaquePointer // users: %18, %10 | |
%10 = address_to_pointer %9 : $*OpaquePointer to $Builtin.RawPointer // user: %11 | |
%11 = struct $UnsafePointer<OpaquePointer> (%10 : $Builtin.RawPointer) // user: %17 | |
%12 = integer_literal $Builtin.Int64, 0 // user: %13 | |
%13 = struct $Int (%12 : $Builtin.Int64) // user: %17 | |
%14 = integer_literal $Builtin.Int64, 0 // user: %15 | |
%15 = struct $Int (%14 : $Builtin.Int64) // users: %50, %17 | |
// function_ref _swift_tfc_StartTensorComputation | |
%16 = function_ref @_swift_tfc_StartTensorComputation : $@convention(thin) (UnsafeRawPointer, Int, UnsafePointer<Int8>, UnsafePointer<OpaquePointer>, Int, Int, Int) -> @owned _TensorComputation // user: %17 | |
%17 = apply %16(%4, %6, %5, %11, %13, %7, %15) : $@convention(thin) (UnsafeRawPointer, Int, UnsafePointer<Int8>, UnsafePointer<OpaquePointer>, Int, Int, Int) -> @owned _TensorComputation // users: %43, %31, %50 | |
end_access %9 : $*OpaquePointer // id: %18 | |
dealloc_stack %8 : $*OpaquePointer // id: %19 | |
%20 = global_value @$S4main4testyyFTv_ : $_ContiguousArrayStorage<Int32> // users: %32, %22, %21 | |
strong_retain %20 : $_ContiguousArrayStorage<Int32> // id: %21 | |
%22 = unchecked_ref_cast %20 : $_ContiguousArrayStorage<Int32> to $Builtin.BridgeObject // user: %23 | |
%23 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%22 : $Builtin.BridgeObject) // user: %24 | |
%24 = struct $_ArrayBuffer<Int32> (%23 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %25 | |
%25 = struct $Array<Int32> (%24 : $_ArrayBuffer<Int32>) // user: %27 | |
// function_ref __tf_tensor_from_scalars_1d | |
%26 = function_ref @__tf_tensor_from_scalars_1d : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %39, %27 | |
%27 = apply %26<Int32>(%25) : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %31, %54 | |
%28 = integer_literal $Builtin.Int64, 0 // user: %29 | |
%29 = struct $Int (%28 : $Builtin.Int64) // user: %31 | |
// function_ref TensorHandle.sendToAccelerator(_:_:) | |
%30 = function_ref @$S10TensorFlow0A6HandleC17sendToAcceleratoryyAA01_A11ComputationC_SitF : $@convention(method) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed _TensorComputation, Int, @guaranteed TensorHandle<τ_0_0>) -> () // user: %31 | |
%31 = apply %30<Int32>(%17, %29, %27) : $@convention(method) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed _TensorComputation, Int, @guaranteed TensorHandle<τ_0_0>) -> () | |
strong_release %20 : $_ContiguousArrayStorage<Int32> // id: %32 | |
%33 = global_value @$S4main4testyyFTv0_ : $_ContiguousArrayStorage<Int32> // users: %44, %35, %34 | |
strong_retain %33 : $_ContiguousArrayStorage<Int32> // id: %34 | |
%35 = unchecked_ref_cast %33 : $_ContiguousArrayStorage<Int32> to $Builtin.BridgeObject // user: %36 | |
%36 = struct $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore> (%35 : $Builtin.BridgeObject) // user: %37 | |
%37 = struct $_ArrayBuffer<Int32> (%36 : $_BridgeStorage<_ContiguousArrayStorageBase, _NSArrayCore>) // user: %38 | |
%38 = struct $Array<Int32> (%37 : $_ArrayBuffer<Int32>) // user: %39 | |
%39 = apply %26<Int32>(%38) : $@convention(thin) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed Array<τ_0_0>) -> @owned TensorHandle<τ_0_0> // users: %43, %53 | |
%40 = integer_literal $Builtin.Int64, 1 // user: %41 | |
%41 = struct $Int (%40 : $Builtin.Int64) // user: %43 | |
// function_ref TensorHandle.sendToAccelerator(_:_:) | |
%42 = function_ref @$S10TensorFlow0A6HandleC17sendToAcceleratoryyAA01_A11ComputationC_SitF : $@convention(method) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed _TensorComputation, Int, @guaranteed TensorHandle<τ_0_0>) -> () // user: %43 | |
%43 = apply %42<Int32>(%17, %41, %39) : $@convention(method) <τ_0_0 where τ_0_0 : AccelerableByTensorFlow> (@guaranteed _TensorComputation, Int, @guaranteed TensorHandle<τ_0_0>) -> () | |
strong_release %33 : $_ContiguousArrayStorage<Int32> // id: %44 | |
%45 = alloc_stack $OpaquePointer // users: %52, %46 | |
%46 = begin_access [modify] [static] %45 : $*OpaquePointer // users: %51, %47 | |
%47 = address_to_pointer %46 : $*OpaquePointer to $Builtin.RawPointer // user: %48 | |
%48 = struct $UnsafeMutablePointer<OpaquePointer> (%47 : $Builtin.RawPointer) // user: %50 | |
// function_ref _swift_tfc_FinishTensorComputation | |
%49 = function_ref @_swift_tfc_FinishTensorComputation : $@convention(thin) (@guaranteed _TensorComputation, UnsafeMutablePointer<OpaquePointer>, Int) -> () // user: %50 | |
%50 = apply %49(%17, %48, %15) : $@convention(thin) (@guaranteed _TensorComputation, UnsafeMutablePointer<OpaquePointer>, Int) -> () | |
end_access %46 : $*OpaquePointer // id: %51 | |
dealloc_stack %45 : $*OpaquePointer // id: %52 | |
strong_release %39 : $TensorHandle<Int32> // id: %53 | |
strong_release %27 : $TensorHandle<Int32> // id: %54 | |
%55 = tuple () // user: %56 | |
return %55 : $() // id: %56 | |
} // end sil function '$S4main4testyyF' | |
--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment