def _nodef_to_private_pond(converter, x):
    'Map a NodeDef x to a PrivatePondTensor.'
    dtype = x.attr['dtype'].type
    warn_msg = 'Unexpected dtype {} found at node {}'
    err_msg = 'Unsupported dtype {} found at node {}'
    x_shape = [i.size for i in x.attr['value'].tensor.tensor_shape.dim]
    if (not x_shape):
        if (dtype == tf.float32):
            nums = x.attr['value'].tensor.float_val
        elif (dtype == tf.float64):
            nums = x.attr['value'].tensor.float_val
        elif (dtype == tf.int32):
            logging.warning(warn_msg, dtype, x.name)
            nums = x.attr['value'].tensor.int_val
        else:
            raise TypeError(err_msg.format(dtype, x.name))

        def inputter_fn():
            return tf.constant(np.array(nums).reshape(1, 1))
    else:
        if (dtype == tf.float32):
            nums = array.array('f', x.attr['value'].tensor.tensor_content)
        elif (dtype == tf.float64):
            nums = array.array('d', x.attr['value'].tensor.tensor_content)
        elif (dtype == tf.int32):
            logging.warning(warn_msg, dtype, x.name)
            nums = array.array('i', x.attr['value'].tensor.tensor_content)
        else:
            raise TypeError(err_msg.format(dtype, x.name))

        def inputter_fn():
            return tf.constant(np.array(nums).reshape(x_shape))
    x_private = converter.protocol.define_private_input(converter.model_provider, inputter_fn)
    return x_private
Map a NodeDef x to a PrivatePondTensor.
def _nodef_to_private_pond(converter, x):
    
    dtype = x.attr['dtype'].type
    warn_msg = 'Unexpected dtype {} found at node {}'
    err_msg = 'Unsupported dtype {} found at node {}'
    x_shape = [i.size for i in x.attr['value'].tensor.tensor_shape.dim]
    if (not x_shape):
        if (dtype == tf.float32):
            nums = x.attr['value'].tensor.float_val
        elif (dtype == tf.float64):
            nums = x.attr['value'].tensor.float_val
        elif (dtype == tf.int32):
            logging.warning(warn_msg, dtype, x.name)
            nums = x.attr['value'].tensor.int_val
        else:
            raise TypeError(err_msg.format(dtype, x.name))

        def inputter_fn():
            return tf.constant(np.array(nums).reshape(1, 1))
    else:
        if (dtype == tf.float32):
            nums = array.array('f', x.attr['value'].tensor.tensor_content)
        elif (dtype == tf.float64):
            nums = array.array('d', x.attr['value'].tensor.tensor_content)
        elif (dtype == tf.int32):
            logging.warning(warn_msg, dtype, x.name)
            nums = array.array('i', x.attr['value'].tensor.tensor_content)
        else:
            raise TypeError(err_msg.format(dtype, x.name))

        def inputter_fn():
            return tf.constant(np.array(nums).reshape(x_shape))
    x_private = converter.protocol.define_private_input(converter.model_provider, inputter_fn)
    return x_private