/Keras_tensorflow/source/tensorflow/python/framework/test_ops.py

https://github.com/ryfeus/lambda-packs · Python · 266 lines · 153 code · 43 blank · 70 comment · 0 complexity · c569edfaa46d0ffbaad830764c67da97 MD5 · raw file

  1. """Python wrappers around Brain.
  2. This file is MACHINE GENERATED! Do not edit.
  3. """
  4. import collections as _collections
  5. from google.protobuf import text_format as _text_format
  6. from tensorflow.core.framework import op_def_pb2 as _op_def_pb2
  7. # Needed to trigger the call to _set_call_cpp_shape_fn.
  8. from tensorflow.python.framework import common_shapes as _common_shapes
  9. from tensorflow.python.framework import op_def_registry as _op_def_registry
  10. from tensorflow.python.framework import ops as _ops
  11. from tensorflow.python.framework import op_def_library as _op_def_library
  12. _graph_def_version_outputs = ["version"]
  13. def graph_def_version(name=None):
  14. r"""TODO: add doc.
  15. Args:
  16. name: A name for the operation (optional).
  17. Returns:
  18. A `Tensor` of type `int32`.
  19. """
  20. result = _op_def_lib.apply_op("GraphDefVersion", name=name)
  21. return result
  22. _ops.RegisterShape("GraphDefVersion")(None)
  23. _kernel_label_outputs = ["result"]
  24. def kernel_label(name=None):
  25. r"""TODO: add doc.
  26. Args:
  27. name: A name for the operation (optional).
  28. Returns:
  29. A `Tensor` of type `string`.
  30. """
  31. result = _op_def_lib.apply_op("KernelLabel", name=name)
  32. return result
  33. _ops.RegisterShape("KernelLabel")(None)
  34. _old_outputs = [""]
  35. def old(name=None):
  36. r"""TODO: add doc.
  37. Args:
  38. name: A name for the operation (optional).
  39. Returns:
  40. The created Operation.
  41. """
  42. result = _op_def_lib.apply_op("Old", name=name)
  43. return result
  44. _ops.RegisterShape("Old")(None)
  45. _resource_create_op_outputs = [""]
  46. def resource_create_op(resource, name=None):
  47. r"""TODO: add doc.
  48. Args:
  49. resource: A `Tensor` of type `resource`.
  50. name: A name for the operation (optional).
  51. Returns:
  52. The created Operation.
  53. """
  54. result = _op_def_lib.apply_op("ResourceCreateOp", resource=resource,
  55. name=name)
  56. return result
  57. _ops.RegisterShape("ResourceCreateOp")(None)
  58. _resource_initialized_op_outputs = ["initialized"]
  59. def resource_initialized_op(resource, name=None):
  60. r"""TODO: add doc.
  61. Args:
  62. resource: A `Tensor` of type `resource`.
  63. name: A name for the operation (optional).
  64. Returns:
  65. A `Tensor` of type `bool`.
  66. """
  67. result = _op_def_lib.apply_op("ResourceInitializedOp", resource=resource,
  68. name=name)
  69. return result
  70. _ops.RegisterShape("ResourceInitializedOp")(None)
  71. _resource_using_op_outputs = [""]
  72. def resource_using_op(resource, name=None):
  73. r"""TODO: add doc.
  74. Args:
  75. resource: A `Tensor` of type `resource`.
  76. name: A name for the operation (optional).
  77. Returns:
  78. The created Operation.
  79. """
  80. result = _op_def_lib.apply_op("ResourceUsingOp", resource=resource,
  81. name=name)
  82. return result
  83. _ops.RegisterShape("ResourceUsingOp")(None)
  84. _stub_resource_handle_op_outputs = ["resource"]
  85. def stub_resource_handle_op(container=None, shared_name=None, name=None):
  86. r"""Creates a handle to a StubResource
  87. Args:
  88. container: An optional `string`. Defaults to `""`.
  89. shared_name: An optional `string`. Defaults to `""`.
  90. name: A name for the operation (optional).
  91. Returns:
  92. A `Tensor` of type `resource`.
  93. """
  94. result = _op_def_lib.apply_op("StubResourceHandleOp", container=container,
  95. shared_name=shared_name, name=name)
  96. return result
  97. _ops.RegisterShape("StubResourceHandleOp")(None)
  98. _test_string_output_outputs = ["output1", "output2"]
  99. _TestStringOutputOutput = _collections.namedtuple("TestStringOutput",
  100. _test_string_output_outputs)
  101. def test_string_output(input, name=None):
  102. r"""TODO: add doc.
  103. Args:
  104. input: A `Tensor` of type `float32`.
  105. name: A name for the operation (optional).
  106. Returns:
  107. A tuple of `Tensor` objects (output1, output2).
  108. output1: A `Tensor` of type `float32`.
  109. output2: A `Tensor` of type `string`.
  110. """
  111. result = _op_def_lib.apply_op("TestStringOutput", input=input, name=name)
  112. return _TestStringOutputOutput._make(result)
  113. _ops.RegisterShape("TestStringOutput")(None)
  114. def _InitOpDefLibrary():
  115. op_list = _op_def_pb2.OpList()
  116. _text_format.Merge(_InitOpDefLibrary.op_list_ascii, op_list)
  117. _op_def_registry.register_op_list(op_list)
  118. op_def_lib = _op_def_library.OpDefLibrary()
  119. op_def_lib.add_op_list(op_list)
  120. return op_def_lib
  121. _InitOpDefLibrary.op_list_ascii = """op {
  122. name: "GraphDefVersion"
  123. output_arg {
  124. name: "version"
  125. type: DT_INT32
  126. }
  127. is_stateful: true
  128. }
  129. op {
  130. name: "KernelLabel"
  131. output_arg {
  132. name: "result"
  133. type: DT_STRING
  134. }
  135. }
  136. op {
  137. name: "Old"
  138. deprecation {
  139. version: 8
  140. explanation: "For reasons"
  141. }
  142. }
  143. op {
  144. name: "ResourceCreateOp"
  145. input_arg {
  146. name: "resource"
  147. type: DT_RESOURCE
  148. }
  149. }
  150. op {
  151. name: "ResourceInitializedOp"
  152. input_arg {
  153. name: "resource"
  154. type: DT_RESOURCE
  155. }
  156. output_arg {
  157. name: "initialized"
  158. type: DT_BOOL
  159. }
  160. }
  161. op {
  162. name: "ResourceUsingOp"
  163. input_arg {
  164. name: "resource"
  165. type: DT_RESOURCE
  166. }
  167. }
  168. op {
  169. name: "StubResourceHandleOp"
  170. output_arg {
  171. name: "resource"
  172. type: DT_RESOURCE
  173. }
  174. attr {
  175. name: "container"
  176. type: "string"
  177. default_value {
  178. s: ""
  179. }
  180. }
  181. attr {
  182. name: "shared_name"
  183. type: "string"
  184. default_value {
  185. s: ""
  186. }
  187. }
  188. is_stateful: true
  189. }
  190. op {
  191. name: "TestStringOutput"
  192. input_arg {
  193. name: "input"
  194. type: DT_FLOAT
  195. }
  196. output_arg {
  197. name: "output1"
  198. type: DT_FLOAT
  199. }
  200. output_arg {
  201. name: "output2"
  202. type: DT_STRING
  203. }
  204. }
  205. """
  206. _op_def_lib = _InitOpDefLibrary()