提交 c32fb8a4 authored 作者: sentient07's avatar sentient07

Added test for scalar with and without future division

上级 a2cf238f
from __future__ import division
import theano
import theano.tensor as T
import unittest
class test_FutureDiv(unittest.TestCase):
def test_divide_floats(self):
a = T.dscalar('a')
b = T.dscalar('b')
c = theano.function([a, b], b / a)
d = theano.function([a, b], b // a)
assert c(6, 3) == 0.5
assert d(6, 3) == 0.0
import theano
import theano.tensor as T
import unittest
class test_FutureDiv(unittest.TestCase):
def test_divide_floats(self):
a = T.dscalar('a')
b = T.dscalar('b')
c = theano.function([a, b], b / a)
d = theano.function([a, b], b // a)
assert c(6, 3) == 0.5
assert d(6, 3) == 0.0
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论