# Source code for mindspore.ops.operations.random_ops

# Copyright 2020 Huawei Technologies Co., Ltd
#
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# ============================================================================

"""Operators for random."""

from ..._checkparam import Validator as validator
from ..._checkparam import Rel
from ...common import dtype as mstype
from ..primitive import PrimitiveWithInfer, prim_attr_register

"""
Generates a random samply as index tensor with a mask tensor from a given tensor.

The input must be a tensor of rank >= 1. If its rank >= 2, the first dimension specify the number of sample.
The index tensor and the mask tensor have the fixed shapes. The index tensor denotes the index of the nonzero
sample, while the mask tensor denotes which elements in the index tensor are valid.

Args:
count (int): Number of items expected to get and the number should be greater than 0. Default: 256.
seed (int): Random seed. Default: 0.
seed2 (int): Random seed2. Default: 0.

Inputs:
- **input_x** (Tensor[bool]) - The input tensor.

Outputs:
Two tensors, the first one is the index tensor and the other one is the mask tensor.

- **index** (Tensor) - The output has shape between 2-D and 5-D.
- **mask** (Tensor) - The output has shape 1-D.

Examples:
>>> input_x = Tensor(np.ones(shape=[240000, 4]).astype(np.bool))
"""

@prim_attr_register
def __init__(self, count=256, seed=0, seed2=0):