forked from 626_privacy/tensorflow_privacy
Merge pull request #1 from cclauss/python3-fixes
Fix Python 3 compatibility issues
This commit is contained in:
commit
8c53cf8f75
4 changed files with 20 additions and 0 deletions
|
@ -46,6 +46,11 @@ import sys
|
|||
import numpy as np
|
||||
from scipy import special
|
||||
|
||||
try:
|
||||
long
|
||||
except NameError:
|
||||
long = int
|
||||
|
||||
########################
|
||||
# LOG-SPACE ARITHMETIC #
|
||||
########################
|
||||
|
|
|
@ -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."""
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue