tf-keras-skeleton.py 文件源码

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

项目:LIE 作者: EmbraceLife 项目源码 文件源码
def compute_output_shape(self, input_shape):
            if input_shape[0] is None:
              output_shape = None
            else:
              output_shape = input_shape[0][1:]
            for i in range(1, len(input_shape)):
              if input_shape[i] is None:
                shape = None
              else:
                shape = input_shape[i][1:]
              output_shape = self._compute_elemwise_op_output_shape(output_shape, shape)
            batch_sizes = [s[0] for s in input_shape if s is not None]
            batch_sizes = set(batch_sizes)
            batch_sizes -= set([None])
            if len(batch_sizes) == 1:
              output_shape = (list(batch_sizes)[0],) + output_shape
            else:
              output_shape = (None,) + output_shape
            return output_shape
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号