Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

_vjpConv2DBackpropInput using shape instead of using filter size for … #331

Merged
merged 3 commits into from
Jul 3, 2019
Merged
Changes from 2 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
4 changes: 2 additions & 2 deletions Sources/TensorFlow/Operators/NN.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ func _vjpConv2DBackpropInput<Scalar: TensorFlowFloatingPoint>(
) -> (Tensor<Scalar>, (Tensor<Scalar>) -> (Tensor<Scalar>, Tensor<Scalar>)) {
let value = conv2DBackpropInput(x, shape: shape, filter: filter,
strides: strides, padding: padding, dilations: dilations)
return (value, { v in
(conv2DBackpropFilter(x, input: v, filterSizes: shape, strides: strides,
return (value, { [filterShape = filter.shapeTensor] v in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this pullback is already capturing filter (on line 190), so I think your original implementation is better! I reverted it for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

(conv2DBackpropFilter(x, input: v, filterSizes: filterShape, strides: strides,
padding: padding, dilations: dilations),
conv2D(v, filter: filter, strides: strides, padding: padding, dilations: dilations))
})
Expand Down