import tensorflow as tf

  keepdims: A boolean, whether to keep the dimensions or not.
    If keepdims is False, the rank of the tensor is reduced
    by 1 for each entry in axis. If keep_dims is True,
    the reduced dimensions are retained with length 1.

  Returns
  -------
  A tensor with the mean of elements of x.
  """
  axis = _normalize_axis(axis, get_ndim(x))
  if x.dtype.base_dtype == tf.bool:
    x = tf.cast(x, tf.float32)
  return tf.reduce_mean(x, axis=axis, keep_dims=keepdims)


def dot(x, y):
  """Multiplies 2 tensors (and/or variables) and returns a *tensor*.
  When attempting to multiply a ND tensor
  with a ND tensor, it reproduces the Theano behavior.
  (e.g. (2, 3).(4, 3, 5) = (2, 4, 5))

  Parameters
  ----------
  x: Tensor or variable.
