def sigmoid_backward(x, dout):
    """
    Computes gradients of Sigmoid activation for input tensor.

    Inputs:
    - x: Input data. of arbitary shape
    - dout: Upstream derivatives

    Returns:
    - dx: Gradient with respect to x
    """
    dx = dout * (1.0 - dout)
    grads = dict({'x': dx})
    return grads
