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

Function constant

tensorflow/python/keras/backend.py:914–929  ·  view source on GitHub ↗

Creates a constant tensor. Arguments: value: A constant value (or list) dtype: The type of the elements of the resulting tensor. shape: Optional dimensions of resulting tensor. name: Optional name for the tensor. Returns: A Constant Tensor.

(value, dtype=None, shape=None, name=None)

Source from the content-addressed store, hash-verified

912
913@keras_export('keras.backend.constant')
914def constant(value, dtype=None, shape=None, name=None):
915 """Creates a constant tensor.
916
917 Arguments:
918 value: A constant value (or list)
919 dtype: The type of the elements of the resulting tensor.
920 shape: Optional dimensions of resulting tensor.
921 name: Optional name for the tensor.
922
923 Returns:
924 A Constant Tensor.
925 """
926 if dtype is None:
927 dtype = floatx()
928
929 return constant_op.constant(value, dtype=dtype, shape=shape, name=name)
930
931
932def is_keras_tensor(x):

Callers

nothing calls this directly

Calls 2

floatxFunction · 0.85
constantMethod · 0.45

Tested by

no test coverage detected