MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _constant_to_tensor

Function _constant_to_tensor

tensorflow/python/keras/backend.py:654–668  ·  view source on GitHub ↗

Convert the input `x` to a tensor of type `dtype`. This is slightly faster than the _to_tensor function, at the cost of handling fewer cases. Arguments: x: An object to be converted (numpy arrays, floats, ints and lists of them). dtype: The destination type. Returns:

(x, dtype)

Source from the content-addressed store, hash-verified

652
653
654def _constant_to_tensor(x, dtype):
655 """Convert the input `x` to a tensor of type `dtype`.
656
657 This is slightly faster than the _to_tensor function, at the cost of
658 handling fewer cases.
659
660 Arguments:
661 x: An object to be converted (numpy arrays, floats, ints and lists of
662 them).
663 dtype: The destination type.
664
665 Returns:
666 A tensor.
667 """
668 return constant_op.constant(x, dtype=dtype)
669
670
671def _to_tensor(x, dtype):

Callers 7

sqrtFunction · 0.85
clipFunction · 0.85
reluFunction · 0.85
categorical_crossentropyFunction · 0.85
binary_crossentropyFunction · 0.85
hard_sigmoidFunction · 0.85

Calls 1

constantMethod · 0.45

Tested by

no test coverage detected