Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions minitorch/tensor_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def map(fn):
should broadcast with `a`

Returns:
:class:`TensorData` : new tensor data
function: A function that takes a tensor, applies `fn` to each cell,
and returns the resulting tensor.
"""

f = tensor_map(fn)
Expand Down Expand Up @@ -160,7 +161,8 @@ def zip(fn):
b (:class:`TensorData`): tensor to zip over

Returns:
:class:`TensorData` : new tensor data
function: A function that takes two tensors, applies `fn` to each pair
of cells, and returns the resulting tensor.
"""

f = tensor_zip(fn)
Expand Down Expand Up @@ -225,7 +227,9 @@ def reduce(fn, start=0.0):
dim (int): int of dim to reduce

Returns:
:class:`TensorData` : new tensor
function: A function that takes a tensor, applies `fn` to all cells
along a particular axis (or all cells if `dim` is not specified), and
returns the resulting tensor.
"""
f = tensor_reduce(fn)

Expand Down