{"id":10115,"date":"2018-01-17T00:30:57","date_gmt":"2018-01-17T05:30:57","guid":{"rendered":"httpss:\/\/www.powenko.com\/wordpress\/?p=10115"},"modified":"2018-01-17T00:32:19","modified_gmt":"2018-01-17T05:32:19","slug":"07-constant-%e8%b3%87%e6%96%99%e5%9e%8b%e6%85%8b","status":"publish","type":"post","link":"https:\/\/www.powenko.com\/wordpress\/?p=10115","title":{"rendered":"07 Constant  \u8cc7\u6599\u578b\u614b"},"content":{"rendered":"<p>Constant \u53ef\u4ee5\u5b58\u653e\u591a\u6a23\u5f0f\u7684\u8cc7\u6599\u578b\u614b\uff0c\u5e38\u898b\u7684\u8cc7\u6599\u578b\u614b\u6709\uff1a<br \/>\n\u2022 tf.float16: 16-bit \u534a\u7cbe\u5ea6\u6d6e\u9ede\u3002<br \/>\n\u2022 tf.float32: 32-bit \u55ae\u7cbe\u5ea6\u6d6e\u9ede\u3002<br \/>\n\u2022 tf.float64\uff1a64\u4f4d\u96d9\u7cbe\u5ea6\u6d6e\u9ede\u3002<br \/>\n\u2022 tf.bfloat16\uff1a16\u4f4d\u622a\u65b7\u6d6e\u9ede\u3002<br \/>\n\u2022 tf.complex64\uff1a64\u4f4d\u55ae\u7cbe\u5ea6\u8907\u5408\u9ad4\u3002<br \/>\n\u2022 tf.complex128\uff1a128\u4f4d\u96d9\u7cbe\u5ea6\u8907\u5408\u9ad4\u3002<br \/>\n\u2022 tf.int8\uff1a8\u4f4d\u6709\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.uint8\uff1a8\u4f4d\u7121\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.uint16\uff1a16\u4f4d\u7121\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.int16\uff1a16\u4f4d\u6709\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.int32\uff1a32\u4f4d\u6709\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.int64\uff1a64\u4f4d\u6709\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.bool\uff1a\u5e03\u6797\u4ee3\u6578\u3002<br \/>\n\u2022 tf.string\uff1a\u5b57\u7b26\u4e32\u3002<br \/>\n\u2022 tf.qint8\uff1a\u91cf\u5316\u76848\u4f4d\u6709\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.quint8\uff1a\u91cf\u5316\u76848\u4f4d\u7121\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.qint16\uff1a\u91cf\u5316\u768416\u4f4d\u6709\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.quint16\uff1a\u91cf\u5316\u768416\u4f4d\u7121\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.qint32\uff1a\u91cf\u5316\u768432\u4f4d\u6709\u7b26\u865f\u6574\u6578\u3002<br \/>\n\u2022 tf.resource\uff1a\u8655\u7406\u53ef\u8b8a\u8cc7\u6e90\u3002<br \/>\n\u2022 tf.variant\uff1a\u4efb\u610f\u985e\u578b\u7684\u503c\u3002<\/p>\n<p>\u7bc4\u4f8b\u7a0b\u5f0f06_string.py<br \/>\n1. import tensorflow as tf<br \/>\n2. node1 = tf.constant(&#8220;Hello&#8221;)<br \/>\n3. node2 = tf.constant(&#8221; www.PowenKo.com&#8221;)<br \/>\n4. print(node1, node2)<br \/>\n5. sess = tf.Session()<br \/>\n6. print(sess.run(node1+node2))<\/p>\n<p>\u8f38\u51fa\u70ba<br \/>\n(&lt;tf.Tensor &#8216;Const:0&#8217; shape=() dtype=string&gt;, &lt;tf.Tensor &#8216;Const_1:0&#8217; shape=() dtype=string&gt;)<br \/>\n2018-01-16 21:01:30.890335: I tensorflow\/core\/platform\/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA<br \/>\nHello www.PowenKo.com<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"httpss:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10109 size-full\" src=\"httpss:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6.png\" alt=\"\" width=\"976\" height=\"87\" srcset=\"https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6.png 976w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6-300x27.png 300w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6-570x51.png 570w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6-768x68.png 768w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6-316x28.png 316w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6-120x11.png 120w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6-210x19.png 210w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6-496x44.png 496w, https:\/\/www.powenko.com\/wordpress\/wp-content\/uploads\/2018\/01\/6-140x12.png 140w\" sizes=\"(max-width: 976px) 100vw, 976px\" \/><\/a><\/p>\n<p>\u57166 \u57f7\u884c\u7d50\u679c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Constant \u53ef\u4ee5\u5b58\u653e\u591a\u6a23\u5f0f\u7684\u8cc7\u6599\u578b\u614b\uff0c\u5e38\u898b\u7684\u8cc7\u6599\u578b\u614b\u6709\uff1a \u2022 tf.float16: 16-bit \u534a\u7cbe [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":10109,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[360],"tags":[],"class_list":["post-10115","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ch02-"],"_links":{"self":[{"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/10115"}],"collection":[{"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10115"}],"version-history":[{"count":3,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/10115\/revisions"}],"predecessor-version":[{"id":10119,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/10115\/revisions\/10119"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=\/wp\/v2\/media\/10109"}],"wp:attachment":[{"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.powenko.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}