Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/tensorflow/python/user_ops/ops/gen_user_ops.py: 37%

46 statements  

« prev     ^ index     » next       coverage.py v7.4.0, created at 2024-01-03 07:57 +0000

1"""Python wrappers around TensorFlow ops. 

2 

3This file is MACHINE GENERATED! Do not edit. 

4""" 

5 

6import collections 

7 

8from tensorflow.python import pywrap_tfe as pywrap_tfe 

9from tensorflow.python.eager import context as _context 

10from tensorflow.python.eager import core as _core 

11from tensorflow.python.eager import execute as _execute 

12from tensorflow.python.framework import dtypes as _dtypes 

13from tensorflow.security.fuzzing.py import annotation_types as _atypes 

14 

15from tensorflow.python.framework import op_def_registry as _op_def_registry 

16from tensorflow.python.framework import ops as _ops 

17from tensorflow.python.framework import op_def_library as _op_def_library 

18from tensorflow.python.util.deprecation import deprecated_endpoints 

19from tensorflow.python.util import dispatch as _dispatch 

20from tensorflow.python.util.tf_export import tf_export 

21 

22from typing import TypeVar 

23 

24def fact(name=None): 

25 r"""Output a fact about factorials. 

26 

27 Args: 

28 name: A name for the operation (optional). 

29 

30 Returns: 

31 A `Tensor` of type `string`. 

32 """ 

33 _ctx = _context._context or _context.context() 

34 tld = _ctx._thread_local_data 

35 if tld.is_eager: 

36 try: 

37 _result = pywrap_tfe.TFE_Py_FastPathExecute( 

38 _ctx, "Fact", name) 

39 return _result 

40 except _core._NotOkStatusException as e: 

41 _ops.raise_from_not_ok_status(e, name) 

42 except _core._FallbackException: 

43 pass 

44 try: 

45 return fact_eager_fallback( 

46 name=name, ctx=_ctx) 

47 except _core._SymbolicException: 

48 pass # Add nodes to the TensorFlow graph. 

49 # Add nodes to the TensorFlow graph. 

50 _, _, _op, _outputs = _op_def_library._apply_op_helper( 

51 "Fact", name=name) 

52 _result = _outputs[:] 

53 if _execute.must_record_gradient(): 

54 _attrs = () 

55 _inputs_flat = _op.inputs 

56 _execute.record_gradient( 

57 "Fact", _inputs_flat, _attrs, _result) 

58 _result, = _result 

59 return _result 

60 

61Fact = tf_export("raw_ops.Fact")(_ops.to_raw_op(fact)) 

62 

63 

64def fact_eager_fallback(name, ctx): 

65 _inputs_flat = [] 

66 _attrs = None 

67 _result = _execute.execute(b"Fact", 1, inputs=_inputs_flat, attrs=_attrs, 

68 ctx=ctx, name=name) 

69 if _execute.must_record_gradient(): 

70 _execute.record_gradient( 

71 "Fact", _inputs_flat, _attrs, _result) 

72 _result, = _result 

73 return _result 

74