Skip to content

Commit

Permalink
adding testing exmaples
Browse files Browse the repository at this point in the history
  • Loading branch information
Aarsh2001 committed Nov 5, 2023
1 parent 264cd9f commit ebee5eb
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion dummy-files/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,20 @@
def _reshape_fortran_tf(x, shape):
if len(x.shape) > 0:
x = tf.transpose(x)
return tf.transpose(tf.reshape(x, shape[::-1]))
return tf.transpose(tf.reshape(x, shape[::-1]))


def expand_dims(
x: Union[tf.Tensor, tf.Variable],
/,
*,
copy: Optional[bool] = None,
axis: Union[int, Sequence[int]] = 0,
out: Optional[Union[tf.Tensor, tf.Variable]] = None,
) -> Union[tf.Tensor, tf.Variable]:
try:
out_shape = _calculate_out_shape(axis, x.shape)
ret = tf.reshape(x, shape=out_shape)
return ret
except (tf.errors.InvalidArgumentError, np.AxisError) as error:
raise ivy.utils.exceptions.IvyIndexError(error)

0 comments on commit ebee5eb

Please sign in to comment.