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

Function expand_dims

tensorflow/python/keras/backend.py:2956–2966  ·  view source on GitHub ↗

Adds a 1-sized dimension at index "axis". Arguments: x: A tensor or variable. axis: Position where to add a new axis. Returns: A tensor with expanded dimensions.

(x, axis=-1)

Source from the content-addressed store, hash-verified

2954
2955@keras_export('keras.backend.expand_dims')
2956def expand_dims(x, axis=-1):
2957 """Adds a 1-sized dimension at index "axis".
2958
2959 Arguments:
2960 x: A tensor or variable.
2961 axis: Position where to add a new axis.
2962
2963 Returns:
2964 A tensor with expanded dimensions.
2965 """
2966 return array_ops.expand_dims(x, axis)
2967
2968
2969@keras_export('keras.backend.squeeze')

Callers 2

batch_dotFunction · 0.70
rnnFunction · 0.70

Calls 1

expand_dimsMethod · 0.45

Tested by

no test coverage detected