Skip to content

Conversation

colesbury
Copy link
Member

This implements reshape which has similar semantics to numpy.reshape. It
will return a view of the source tensor if possible. Otherwise, it
returns a copy.

This implements reshape which has similar semantics to numpy.reshape. It
will return a view of the source tensor if possible. Otherwise, it
returns a copy.
@colesbury colesbury requested a review from gchanan March 5, 2018 20:28
return result;
}

static std::vector<int64_t> infer_size(IntList shape, int64_t numel) {

This comment was marked as off-topic.

This comment was marked as off-topic.

static std::vector<int64_t> infer_size(IntList shape, int64_t numel) {
auto res = shape.vec();
int64_t newsize = 1;
auto infer_dim = at::optional<int64_t>();

This comment was marked as off-topic.

view_d--;
}
if (view_numel != tensor_numel) {
return {};

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@soumith soumith merged commit a264150 into pytorch:master Mar 12, 2018
@colesbury colesbury deleted the reshape branch March 12, 2018 21:24
@fmassa fmassa mentioned this pull request Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants