matpipeline.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:blemd 作者: niacdoial 项目源码 文件源码
def __add__(self, other):
        if not isinstance(other, Node):
            other = Node(data=other)
        if other.type == 'val':
            if other.value in (0, Color((0,0,0)), Vector((0,0,0))):
                return self  # useless addition if other is zero
        if self.type == 'val':
            if self.value in (0, Color((0,0,0)), Vector((0,0,0))):
                return other  # useless addition if other is zero
        return Node('ADD', inputs=(self, other))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号