def _required_space_to_batch_paddings(converter, node, inputs: List[str]):
    inputs_node = [converter.outputs[inputs[i]] for i in range(len(inputs))]
    inputs_int32 = []
    for x_in in inputs_node:
        pvt_check = isinstance(x_in, PondPrivateTensor)
        msk_check = isinstance(x_in, PondMaskedTensor)
        if (pvt_check or msk_check):
            logging.warning('Revealing private input: required_space_to_batch_paddings assumes public input.')
            inputs_int32.append(tf.cast(x_in.reveal().decode(), tf.int32))
        elif isinstance(x_in, tf.NodeDef):
            inputs_int32.append(_nodef_to_numpy_array(x_in))
        else:
            raise TypeError('Unexpected input of type {}.'.format(type(x_in)))
    if (len(inputs_int32) == 2):
        (input_shape, block_shape) = inputs_int32

        def inputter_pad():
            (pads, _) = tf.required_space_to_batch_paddings(input_shape, block_shape)
            return tf.cast(pads, tf.float64)

        def inputter_crop():
            (_, crops) = tf.required_space_to_batch_paddings(input_shape, block_shape)
            return tf.cast(crops, tf.float64)
    else:
        (base_paddings, input_shape, block_shape) = inputs_int32

        def inputter_pad():
            (pads, _) = tf.required_space_to_batch_paddings(input_shape, block_shape, base_paddings=base_paddings)
            return tf.cast(pads, tf.float64)

        def inputter_crop():
            (_, crops) = tf.required_space_to_batch_paddings(input_shape, block_shape, base_paddings=base_paddings)
            return tf.cast(crops, tf.float64)
    pad_private = converter.protocol.define_public_input(converter.model_provider, inputter_pad)
    crop_private = converter.protocol.define_public_input(converter.model_provider, inputter_crop)
    return (pad_private, crop_private)
def _required_space_to_batch_paddings(converter, node, inputs: List[str]):
    inputs_node = [converter.outputs[inputs[i]] for i in range(len(inputs))]
    inputs_int32 = []
    for x_in in inputs_node:
        pvt_check = isinstance(x_in, PondPrivateTensor)
        msk_check = isinstance(x_in, PondMaskedTensor)
        if (pvt_check or msk_check):
            logging.warning('Revealing private input: required_space_to_batch_paddings assumes public input.')
            inputs_int32.append(tf.cast(x_in.reveal().decode(), tf.int32))
        elif isinstance(x_in, tf.NodeDef):
            inputs_int32.append(_nodef_to_numpy_array(x_in))
        else:
            raise TypeError('Unexpected input of type {}.'.format(type(x_in)))
    if (len(inputs_int32) == 2):
        (input_shape, block_shape) = inputs_int32

        def inputter_pad():
            (pads, _) = tf.required_space_to_batch_paddings(input_shape, block_shape)
            return tf.cast(pads, tf.float64)

        def inputter_crop():
            (_, crops) = tf.required_space_to_batch_paddings(input_shape, block_shape)
            return tf.cast(crops, tf.float64)
    else:
        (base_paddings, input_shape, block_shape) = inputs_int32

        def inputter_pad():
            (pads, _) = tf.required_space_to_batch_paddings(input_shape, block_shape, base_paddings=base_paddings)
            return tf.cast(pads, tf.float64)

        def inputter_crop():
            (_, crops) = tf.required_space_to_batch_paddings(input_shape, block_shape, base_paddings=base_paddings)
            return tf.cast(crops, tf.float64)
    pad_private = converter.protocol.define_public_input(converter.model_provider, inputter_pad)
    crop_private = converter.protocol.define_public_input(converter.model_provider, inputter_crop)
    return (pad_private, crop_private)