提交 1f5af445 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

pep8 on null_type.py

上级 bb2b5031
from type import Type
from graph import Variable
class NullType(Type):
"""
......@@ -11,7 +12,7 @@ class NullType(Type):
"""
def __init__(self, why_null = '(no explanation given)'):
def __init__(self, why_null='(no explanation given)'):
"""
why_null: A string explaining why this variable
can't take on any values
......@@ -19,14 +20,16 @@ class NullType(Type):
self.why_null = why_null
def filter(self, data, strict=False, allow_downcast=None):
raise ValueError("No values may be assigned to a NullType")
raise ValueError("No values may be assigned to a NullType")
def filter_variable(self, other):
raise ValueError("No values may be assigned to a NullType")
raise ValueError("No values may be assigned to a NullType")
def may_share_memory(a, b):
return False
def values_eq(a, b, force_same_dtype=True):
raise ValueError("NullType has no values to compare")
return False
def values_eq(a, b, force_same_dtype=True):
raise ValueError("NullType has no values to compare")
class NullVariable(Variable):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论