import tensorflow as tf
import numpy as np
input_data = tf.Variable( np.random.rand(10, 9, 9 ,3), dtype = np.float32 )
depthwise_filter = tf.Variable( np.random.rand(2, 2, 3, 5), dtype = np.float32)
pointwise_filter = tf.Variable( np.random.rand(1, 1, 15, 20), dtype = np.float32)
#out_channels >= channel_multiplier * in_channels
y = tf.nn.separable_conv2d(input_data, depthwise_filter, pointwise_filter,strides = [1, 1, 1, 1], padding = 'SAME')
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
print sess.run(y)
print sess.run(tf.shape(y))
[[[[ 7.86455011 9.86276722 9.1250658 ..., 5.59420061 7.06700802
8.67942905]
[ 8.12504292 9.55695248 9.25061798 ..., 5.33287907 7.97310734
8.98744869]
[ 7.33285332 8.6196003 8.15359402 ..., 5.09009314 7.7600069
8.14903736]
...,
[ 9.2003088 11.27749348 10.72342205 ..., 6.08917522 8.52603912
10.10731125]
[ 5.24173594 6.6891799 6.13117695 ..., 3.5324769 4.63966608
5.66407776]
[ 2.02646756 2.65755391 2.34731007 ..., 1.32898295 1.75200427
2.21622205]]
[[ 7.82452583 9.70252419 9.23444176 ..., 5.44197702 7.32682228
8.73246765]
[ 7.5438695 9.38563442 8.87859344 ..., 5.32681513 7.40026188
8.40256119]
[ 9.46050739 11.29448986 10.44388008 ..., 6.29508114 8.33294201
10.11343575]
...,
[ 8.53229618 10.57835197 9.91193295 ..., 5.83303404 7.75608683
9.37142754]
[ 7.60514021 9.3542099 8.87456131 ..., 5.2327795 6.74824476
8.35174942]
[ 3.88612366 5.07439947 4.57054138 ..., 2.63764739 3.66204619
4.35077095]]
[[ 8.86520672 10.68501282 10.1820612 ..., 6.13676023 8.89887428
9.86331463]
[ 7.7135272 9.31022453 8.3677206 ..., 5.23457813 6.79112959
8.25478935]
[ 9.08337975 10.61598206 9.90724373 ..., 5.85011816 7.71738386
9.45709896]
...,
[ 8.92134285 10.7448082 10.5249958 ..., 6.07900047 9.5085783
10.12053967]
[ 8.51602077 10.44511318 10.20405293 ..., 5.86631775 8.36247826
9.46217537]
[ 3.96193171 5.13187218 4.62070656 ..., 2.78452635 3.74937391
4.57562304]]
...,
[[ 6.45036697 7.99898291 7.60772133 ..., 4.43157196 6.07319975
7.17768955]
[ 10.33575916 12.5509491 11.68427467 ..., 6.86151886 8.93147564
10.89049149]
[ 9.64616871 11.9922142 10.64087105 ..., 6.34576941 7.78463316
10.07639885]
...,
[ 8.02497196 9.5499115 8.99458504 ..., 5.44065285 8.02457142
8.82191086]
[ 7.45176649 8.69472504 8.3385601 ..., 4.82634544 7.10034752
8.08318996]
[ 2.63058162 3.38119388 3.02002263 ..., 1.7472086 2.3568995
2.88835049]]
[[ 8.28533268 10.17637539 9.47689056 ..., 5.89476681 7.98855495
9.21703434]
[ 11.95715523 14.29368973 13.68363857 ..., 8.12615967 11.39281559
13.05134201]
[ 10.7359848 12.90753078 12.32284355 ..., 7.19947672 10.85350609
11.91876888]
...,
[ 9.59294319 11.19311523 10.58120537 ..., 6.3221488 9.23640251
10.32434654]
[ 7.38067865 8.81995392 8.19104958 ..., 4.89283037 6.8635664
7.85977888]
[ 2.74312878 3.35960388 3.04312611 ..., 1.79250252 2.4631269
3.00781989]]
[[ 4.07513332 4.71864986 4.29845285 ..., 2.81703663 3.67740059
4.42420673]
[ 5.66469431 6.2926755 6.12661409 ..., 3.75330138 5.43563604
6.07141876]
[ 6.16071463 7.15528011 6.79033947 ..., 4.28821421 5.74823236
6.81279564]
...,
[ 3.90499568 4.38445425 4.19482803 ..., 2.62452626 3.77531743
4.26568604]
[ 3.31131887 3.67493367 3.40902042 ..., 2.16564083 3.05969024
3.55821061]
[ 1.19322073 1.29789746 1.18996131 ..., 0.66988683 1.01834357
1.18553483]]]
[[[ 6.53640223 8.11177731 7.90630102 ..., 4.47263527 6.43050289
7.35826921]
[ 7.90672541 9.99120808 8.91621017 ..., 5.43553495 5.85411119
8.25553131]
[ 10.3349123 12.67383671 11.4871664 ..., 7.08481884 9.21671581
11.09720421]
...,
[ 6.12695217 7.27050638 6.88153076 ..., 4.05991554 5.78277063
6.80414724]
[ 7.13750315 8.66963387 8.40171623 ..., 4.91880989 6.87910128
7.82991076]
[ 3.91652775 5.08108139 4.64483976 ..., 2.7471447 3.8663063
4.48403358]]
[[ 8.07978916 9.7485323 9.16147041 ..., 5.34712029 7.03642178
8.67942238]
[ 8.87792015 10.99547863 10.15996075 ..., 5.96295786 7.49371481
9.44686127]
[ 9.97905731 12.01921654 10.94784737 ..., 6.69695759 9.13620663
10.66994095]
...,
[ 8.33208656 10.16113091 9.56538773 ..., 5.41838074 7.68430233
8.91155243]
[ 7.80285263 9.35440636 9.06045818 ..., 5.48524284 8.11367321
8.78949356]
[ 4.4442029 5.22210741 5.0072999 ..., 2.94328237 4.84764862
5.10298872]]
[[ 9.0234499 10.80304718 10.23378372 ..., 6.03868103 8.52324677
9.65285397]
[ 10.30233574 12.46640205 11.50908661 ..., 6.94129658 9.28429413
11.05395031]
[ 8.84422684 10.67407703 9.98196983 ..., 5.81442308 7.62424278
9.48901463]
...,
[ 8.58601665 10.10876942 10.0147543 ..., 5.79790497 9.1373024
9.70009613]
[ 8.62880325 10.24453259 10.26292133 ..., 6.05732155 9.59494114
9.92952633]
[ 4.47408581 5.41633129 5.19128132 ..., 3.02067113 5.01584721
5.17484474]]
...,
[[ 7.26714087 8.57365799 7.89912653 ..., 4.7518754 6.60957623
7.61971092]
[ 7.15450001 8.60483646 8.11607933 ..., 4.53302097 5.63572931
7.44611073]
[ 6.87383461 8.71233368 8.39023685 ..., 4.70671797 6.3952198
7.63689709]
...,
[ 9.07020283 10.56440544 10.41153812 ..., 5.98829126 9.3532505
9.99484921]
[ 9.56061935 11.62924957 10.63865662 ..., 6.3354969 8.56840801
10.0826025 ]
[ 3.74925399 4.67715883 4.08303833 ..., 2.33014035 2.87478995
3.85580873]]
[[ 6.46569395 7.44718838 6.9453063 ..., 4.18339682 6.08838129
6.8746109 ]
[ 6.39755917 7.87617111 7.16889334 ..., 4.24144363 5.10012293
6.53313732]
[ 8.8129673 10.81852341 10.34794331 ..., 6.24099445 8.51881981
9.88090229]
...,
[ 8.44666672 10.20895863 9.89138794 ..., 5.97722816 8.39779377
9.48333359]
[ 8.31094074 9.97145462 9.5596962 ..., 5.57904577 7.92120504
9.29607201]
[ 2.66037178 3.39733219 3.1232934 ..., 1.78238153 2.70542622
2.99189615]]
[[ 2.7153337 3.05585575 2.85426164 ..., 1.80026078 2.44689536
2.91385603]
[ 3.59446549 4.15670252 3.66317296 ..., 2.2984004 2.6689589
3.59333205]
[ 4.38394308 5.04576683 4.68975449 ..., 2.88929892 3.79133558
4.56226349]
...,
[ 3.40467834 4.15768909 3.81189346 ..., 2.46807003 2.85449886
3.76255631]
[ 3.38187981 4.1445384 3.93029356 ..., 2.37085152 2.82970428
3.66259408]
[ 1.29534972 1.71873021 1.50841224 ..., 1.02836013 1.13686872
1.61311173]]]
[[[ 8.78456211 10.4288578 10.09924889 ..., 5.89213991 8.25746441
9.57630634]
[ 10.28687477 12.66910744 11.69143105 ..., 6.93520975 9.20536232
11.07165337]
[ 10.09778309 12.18028355 11.18496323 ..., 6.55974817 8.50701141
10.62326336]
...,
[ 7.11231995 8.74801445 8.32918453 ..., 4.84006977 6.29774189
7.79711819]
[ 7.63178492 9.39566326 8.51090431 ..., 5.31317616 6.98637342
8.35794544]
[ 3.78494048 4.46575308 4.14221096 ..., 2.3320303 3.58522177
4.01933956]]
[[ 9.81393433 11.78520393 11.48754787 ..., 6.66471958 9.28884315
10.69193459]
[ 11.68537426 14.18356609 13.45025921 ..., 7.99851513 11.38120174
12.98844719]
[ 9.32573223 11.42614651 10.46697426 ..., 6.3144722 8.23250103
9.91044426]
...,
[ 8.76608658 10.80775738 10.01987839 ..., 5.62287378 7.08508492
9.16743565]
[ 7.93351555 9.7706995 8.77610207 ..., 5.53419685 7.20983934
8.60675812]
[ 4.35310173 4.94358301 4.68692017 ..., 2.63783836 4.34296656
4.65238857]]
[[ 10.19390774 11.91633034 11.50970078 ..., 6.76079178 9.60958862
10.88467884]
[ 12.28962612 14.84438133 14.11893559 ..., 8.4619875 12.0595417
13.67067242]
[ 9.53003502 11.222229 10.61397934 ..., 6.45923185 10.16923046
10.71530628]
...,
[ 8.63796043 10.66815758 9.94040585 ..., 5.69916153 7.02916288
9.11094952]
[ 7.69857311 9.62495136 8.73095226 ..., 5.27851009 6.67660379
8.37030411]
[ 3.28365397 3.86420083 3.50895095 ..., 1.98696065 2.92051244
3.45066023]]
...,
[[ 10.62551117 12.82937813 12.18026161 ..., 7.08942175 9.67439461
11.44962978]
[ 8.53035069 10.61397552 10.04547882 ..., 5.75649548 7.96528816
9.39827633]
[ 8.17535305 9.98004341 9.42965221 ..., 5.56611443 7.51590586
8.95677376]
...,
[ 8.95370197 10.95553493 10.0635004 ..., 6.00944042 7.82154322
9.56050777]
[ 6.42801714 8.03363323 7.62321043 ..., 4.36147118 5.32749033
7.01865864]
[ 2.45030069 3.46729755 3.07580137 ..., 1.86878908 2.3612833
2.96015406]]
[[ 7.78291082 9.41970444 8.90674591 ..., 5.40147448 7.28587151
8.56774521]
[ 8.87232494 10.7882185 10.06697655 ..., 6.05458546 7.67896605
9.54250622]
[ 10.42062855 12.89588833 11.73346519 ..., 7.03276014 8.676548
11.03443623]
...,
[ 6.75262165 8.50320244 7.62275743 ..., 4.52997065 5.83697367
7.32406616]
[ 5.09234715 6.29614735 5.84066916 ..., 3.35514522 3.8125751
5.18490934]
[ 2.95712709 3.89107227 3.39908767 ..., 2.06593013 2.47558117
3.35756063]]
[[ 2.62244058 2.99652028 2.78680158 ..., 1.74119115 2.35564327
2.82145238]
[ 3.67566919 4.290627 3.95902467 ..., 2.468431 2.98725724
3.81904411]
[ 5.43342972 6.39088917 5.76700306 ..., 3.60982013 4.28991079
5.6293869 ]
...,
[ 2.98391056 3.72085524 3.3006115 ..., 2.09718084 2.36936235
3.30892038]
[ 2.36674762 2.93001986 2.59067559 ..., 1.59039605 1.51267767
2.35374594]
[ 1.18679309 1.57230139 1.29536772 ..., 0.79022813 0.70956892
1.22312474]]]
...,
[[[ 8.65418625 10.10586262 9.7164135 ..., 5.79555941 8.83032799
9.49445724]
[ 9.20111179 10.94996738 10.51358604 ..., 6.2203536 8.65990162
9.99344063]
[ 8.96598625 11.06022263 10.35838127 ..., 6.14179373 8.00954247
9.82999325]
...,
[ 9.03875446 10.95932198 10.47367668 ..., 6.10961866 8.46690559
9.94402504]
[ 9.8004694 11.65310383 11.24350834 ..., 6.8190918 10.07134724
10.9339447 ]
[ 4.72655439 5.58763695 5.29006338 ..., 3.13333011 4.92767048
5.33617687]]
[[ 8.78163624 10.31001949 9.5912571 ..., 5.7901268 8.44663429
9.47222996]
[ 10.30697918 12.01030064 11.36254692 ..., 6.87161732 9.92200375
11.0611248 ]
[ 8.88821316 10.80216026 9.99812508 ..., 5.85560083 7.90909386
9.48474693]
...,
[ 11.3742981 13.60397911 13.25454712 ..., 7.68010712 11.67696095
12.58360958]
[ 9.50289917 11.54842758 11.0359354 ..., 6.5613389 9.65799141
10.75280476]
[ 3.7686038 4.50122499 4.21536541 ..., 2.45408034 3.85907364
4.26250839]]
[[ 9.68424034 11.64602947 10.63470936 ..., 6.23955441 7.9174366
10.0379734 ]
[ 9.46494865 11.24518013 10.5740242 ..., 6.18866634 8.72775555
10.17795277]
[ 8.43140411 9.87040138 9.45620346 ..., 5.63832951 8.51157475
9.25026989]
...,
[ 12.17500877 14.43800354 14.15905571 ..., 8.39646244 12.46241665
13.66910076]
[ 11.19674015 13.65639019 12.7992115 ..., 7.50040388 10.13602829
12.13777924]
[ 4.11553192 5.35915995 4.71438599 ..., 2.74466944 3.48520255
4.50507402]]
...,
[[ 9.0824461 10.93941498 10.22209644 ..., 6.08667278 8.03910923
9.62092018]
[ 10.83312702 13.30076599 12.20335293 ..., 7.2307272 9.18301105
11.5104351 ]
[ 8.67013836 10.87436771 9.72805595 ..., 5.84121943 6.86710501
9.05821514]
...,
[ 8.68142796 10.40404415 10.12802792 ..., 6.04354572 8.54172325
9.70386505]
[ 8.73657036 10.33071709 9.62351894 ..., 5.88342571 8.08271313
9.53357506]
[ 3.58001232 4.14514256 3.81253457 ..., 2.16529322 3.3087039
3.78246212]]
[[ 11.06619263 13.3241291 12.38664818 ..., 7.41676855 10.34302425
11.96063519]
[ 10.60643959 12.76120853 11.83753395 ..., 7.04295254 9.38307095
11.22310257]
[ 10.28033066 12.25662899 11.3760643 ..., 6.70310545 9.47635937
11.02453327]
...,
[ 5.9523344 7.3519125 7.12139082 ..., 4.16382074 5.77992821
6.70184946]
[ 6.79056168 8.4375639 8.19430923 ..., 4.68402052 6.57651997
7.67327213]
[ 2.9592886 3.90941739 3.65908813 ..., 2.14037085 3.29936123
3.52450013]]
[[ 5.34719896 6.15464687 5.70146036 ..., 3.5995791 4.82629633
5.81143284]
[ 5.50058699 6.35746288 5.83995533 ..., 3.6182735 4.48154879
5.68972826]
[ 5.44654894 6.42178011 5.89039469 ..., 3.66148901 4.57332945
5.76283598]
...,
[ 3.55376077 4.33022404 3.95830154 ..., 2.49681354 2.77559257
3.81717896]
[ 3.85114384 4.79381323 4.50532055 ..., 2.79985118 3.28613067
4.2365694 ]
[ 1.96929479 2.3209784 2.17163444 ..., 1.42500305 2.0213542
2.39025664]]]
[[[ 10.52044582 12.68919849 11.95900249 ..., 7.2407937 10.48161697
11.6777153 ]
[ 7.54583454 8.89180183 8.37923908 ..., 4.93489408 7.01086807
8.15142918]
[ 8.42133427 10.35880184 9.63311768 ..., 5.58082962 6.86053276
8.80280209]
...,
[ 9.07936573 11.49455547 10.41965675 ..., 6.00262594 6.95486355
9.57107353]
[ 7.34484625 9.23769093 8.75268078 ..., 5.1180582 6.86916018
8.15388107]
[ 3.45345259 4.1400671 4.00194168 ..., 2.426085 3.98893261
4.14546204]]
[[ 8.81410122 10.53202534 10.1422348 ..., 6.04652643 9.06471252
9.9519062 ]
[ 7.13803864 8.47875404 7.81732512 ..., 4.75700521 6.69742823
7.58618975]
[ 9.74135876 11.73081493 10.61247826 ..., 6.51005554 8.00913906
10.10412407]
...,
[ 8.18678474 10.22940063 9.48353386 ..., 5.60757065 7.15950108
8.88732147]
[ 6.97615576 8.56890965 8.52706051 ..., 4.9854269 7.52153683
8.10852432]
[ 3.29468846 4.01130819 3.99655485 ..., 2.38100171 4.2520647
4.07320976]]
[[ 7.63192368 9.42352581 8.98932838 ..., 5.34482431 7.41173792
8.62077045]
[ 8.31781673 9.80805016 9.31608009 ..., 5.58207893 8.11722565
9.16546822]
[ 8.72956276 10.25665665 9.68921852 ..., 5.78112173 8.77825642
9.43779373]
...,
[ 8.63837433 10.37889957 9.92931747 ..., 5.87471294 8.83836937
9.6569519 ]
[ 7.25587559 8.59872818 8.14992046 ..., 5.07768202 7.37076283
8.01587009]
[ 3.83996344 4.4716754 4.08467674 ..., 2.46338606 3.4637363
4.25643349]]
...,
[[ 8.4263916 10.27813339 9.36610508 ..., 5.74064112 7.46076393
9.13413334]
[ 9.43415546 11.18238449 10.21996117 ..., 6.15287256 8.03643703
9.83115768]
[ 9.10216904 10.91555214 10.25538254 ..., 6.01776457 8.07285118
9.75028801]
...,
[ 9.46131134 10.92182636 10.71674633 ..., 6.32145691 9.88359547
10.33291721]
[ 10.92905807 13.1683197 12.56227493 ..., 7.38663769 10.40049744
11.96134186]
[ 5.02170467 6.27233934 5.70146513 ..., 3.39331126 4.76110601
5.71925163]]
[[ 10.5311842 12.83275986 11.90817642 ..., 6.93959713 9.52319241
11.26535606]
[ 8.22741508 9.81871796 9.34722424 ..., 5.45829821 8.02117729
8.96128082]
[ 8.88614368 10.67296314 10.02498627 ..., 6.03306437 8.4780159
9.54018593]
...,
[ 8.72192192 9.97892284 9.80834007 ..., 5.94948578 9.35587788
9.78942108]
[ 8.76138878 10.34003735 9.57307911 ..., 5.87642813 7.84835052
9.31678677]
[ 3.73683596 4.56967163 4.11169195 ..., 2.40248871 3.24168277
3.98754644]]
[[ 5.09203434 5.96821499 5.53741741 ..., 3.42772341 4.49568892
5.53398228]
[ 3.88973117 4.53701591 4.40643167 ..., 2.80583262 3.86263752
4.40203238]
[ 3.92987514 4.34820461 4.1123414 ..., 2.65973926 3.92303324
4.40315962]
...,
[ 3.01350522 3.25848913 3.19872928 ..., 1.99726379 3.21602964
3.40867567]
[ 2.04202247 2.1944201 2.14130497 ..., 1.40249944 2.21088123
2.30627751]
[ 1.11368799 1.10729313 1.10710812 ..., 0.64600086 1.21037519
1.20256758]]]
[[[ 6.53810406 7.84984589 7.44999313 ..., 4.36433125 5.86921883
6.97050285]
[ 6.69231606 7.9600296 7.52660847 ..., 4.57786369 7.11741781
7.57106113]
[ 6.58748198 7.51658535 7.47552252 ..., 4.43148279 7.09300852
7.31784916]
...,
[ 7.42615509 8.72403049 8.32900524 ..., 5.09312153 7.45516348
8.40812397]
[ 6.12658882 7.00733709 7.08831072 ..., 3.99578714 6.55257034
6.8261919 ]
[ 2.31253982 2.93142366 2.71563196 ..., 1.59806275 2.42754817
2.69363451]]
[[ 7.75710821 9.30583096 8.84162617 ..., 5.11761093 6.82532024
8.25776386]
[ 7.19683599 8.67567253 8.46961308 ..., 4.90228415 7.36947441
8.14705849]
[ 7.59199619 8.97328949 8.61708736 ..., 5.31225872 8.30461884
8.513237 ]
...,
[ 7.72790909 9.28687954 9.04012299 ..., 5.12911415 7.50067663
8.40213108]
[ 8.03824902 9.82551765 9.34187222 ..., 5.63318634 8.21889591
9.02522182]
[ 3.40762496 4.29760981 3.87581873 ..., 2.29507113 3.08785439
3.81130362]]
[[ 7.05703449 8.64057732 8.00727367 ..., 4.53189516 5.55392313
7.27586079]
[ 7.12869787 8.82059669 8.5550642 ..., 5.15309906 7.5824523
8.28377914]
[ 8.94116402 10.44198799 10.17017841 ..., 6.07649517 8.98750687
9.97559452]
...,
[ 9.60055256 11.49875927 10.97532082 ..., 6.4300189 8.71829319
10.23972034]
[ 8.92724895 10.83894539 9.88642406 ..., 5.99380875 8.02056217
9.75486183]
[ 2.81734896 3.25449443 3.05937815 ..., 1.73498905 2.78878665
3.011379 ]]
...,
[[ 7.76859617 9.01182938 8.68745327 ..., 5.1782341 8.22872543
8.6409893 ]
[ 7.42089605 8.81965065 8.21026897 ..., 4.85998058 6.82682228
7.80108833]
[ 8.07583141 9.61584759 9.20686913 ..., 5.41805458 7.36158657
8.67767906]
...,
[ 10.59672832 12.68664169 12.16494179 ..., 7.27619362 11.01977062
12.02234936]
[ 8.46003342 10.25633049 10.12289906 ..., 5.61241817 8.22113609
9.24954414]
[ 3.40761614 4.60335207 4.11407328 ..., 2.53008652 3.28492475
4.10662031]]
[[ 10.51778126 12.62024593 12.08003807 ..., 7.12596893 10.32965755
11.69734287]
[ 7.23082304 8.80678749 8.13726044 ..., 4.89148712 6.86938143
7.94508648]
[ 6.09078217 7.1552434 7.19673443 ..., 4.02193213 6.23259783
6.79885864]
...,
[ 11.23603249 13.65008163 12.65352726 ..., 7.84008026 10.86867046
12.43640518]
[ 11.07698822 13.16327286 12.51515102 ..., 7.37178802 10.16977406
11.92691708]
[ 4.76566124 6.22580338 5.53603458 ..., 3.2638514 4.22632647
5.34008265]]
[[ 6.28928471 7.43807554 6.82320213 ..., 4.20735455 5.08266306
6.60602093]
[ 3.90119147 4.74565887 4.14525843 ..., 2.57949305 2.86006975
4.05810356]
[ 3.36957645 4.04703236 3.89460039 ..., 2.38773441 2.99767208
3.64036393]
...,
[ 5.07445908 5.90241861 5.28545952 ..., 3.39457512 4.31467819
5.40055132]
[ 5.6617012 6.36621141 5.96114635 ..., 3.62578106 4.82546902
5.80714607]
[ 2.55882502 3.05328608 2.7064836 ..., 1.63889349 2.07778645
2.72518611]]]]
[10 9 9 20]