tensor.utils – Tensor Utils
theano.tensor.utils.
hashfrom_ndarray
(_data)[source]- Return a hash from an ndarray.
It takes care of the data, shapes, strides and dtype.
theano.tensor.utils.
shapeof_variables
(_fgraph, input_shapes)[source]- Compute the numeric shape of all intermediate variables given input shapes.
Parameters:
- fgraph – The theano.FunctionGraph in question.
- input_shapes (dict) – A dict mapping input to shape.Returns:
- shapes (dict) – A dict mapping variable to shape
- .. warning:: This modifies the fgraph. Not pure.
Examples
- >>> import theano
- >>> x = theano.tensor.matrix('x')
- >>> y = x[512:]; y.name = 'y'
- >>> fgraph = theano.FunctionGraph([x], [y], clone=False)
- >>> d = shape_of_variables(fgraph, {x: (1024, 1024)})
- >>> d[y]
- (array(512), array(1024))
- >>> d[x]
- (array(1024), array(1024))
当前内容版权归 deeplearning 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 deeplearning .