Skip to content
Permalink
Browse files

Allowing Conv2D to accept unicode, in addition to str.

PiperOrigin-RevId: 227748726
  • Loading branch information...
Deepmind authored and diegolascasas committed Jan 3, 2019
1 parent 0bfb404 commit a9c6a8d999fb7c7bf4ef2995932522a3ca14d151
Showing with 2 additions and 1 deletion.
  1. +2 −1 sonnet/python/modules/conv.py
@@ -30,6 +30,7 @@
# Dependency imports

import numpy as np
import six
from sonnet.python.modules import base
from sonnet.python.modules import util
import tensorflow as tf
@@ -192,7 +193,7 @@ def _fill_and_verify_padding(padding, n):
if not isinstance(n, numbers.Integral) or n < 1:
raise TypeError("n must be a positive integer")

if isinstance(padding, str) and padding in ALLOWED_PADDINGS:
if isinstance(padding, six.string_types) and padding in ALLOWED_PADDINGS:
return (padding,) * n

try:

0 comments on commit a9c6a8d

Please sign in to comment.
You can’t perform that action at this time.