Merge pull request #1 from cclauss/python3-fixes

Fix Python 3 compatibility issues
This commit is contained in:
Steve Chien 2019-01-07 13:43:22 -08:00 committed by GitHub
commit 8c53cf8f75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 0 deletions

View file

@ -46,6 +46,11 @@ import sys
import numpy as np
from scipy import special
try:
long
except NameError:
long = int
########################
# LOG-SPACE ARITHMETIC #
########################

View file

@ -24,6 +24,11 @@ import tensorflow as tf
from privacy.optimizers import dp_optimizer
try:
xrange
except NameError:
xrange = range
def loss(val0, val1):
"""Loss function that is minimized at the mean of the input points."""

View file

@ -24,6 +24,11 @@ import tensorflow as tf
from privacy.optimizers import gaussian_query
try:
xrange
except NameError:
xrange = range
def _run_query(query, records):
"""Executes query on the given set of records as a single sample.

View file

@ -30,6 +30,11 @@ nest = tf.contrib.framework.nest
_basic_query = gaussian_query.GaussianSumQuery(1.0, 0.0)
try:
xrange
except NameError:
xrange = range
def _run_query(query, records):
"""Executes query on the given set of records as a single sample.