Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batched autodiff #2181

Merged
merged 22 commits into from
Dec 27, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
getShadowType for TensorTypeInterface
  • Loading branch information
jumerckx committed Dec 16, 2024
commit 64489a5662e6daec445141686ac4cede52468069
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ class TensorTypeInterface
}

Type getShadowType(Type self, unsigned width) const {
assert(width == 1 && "unsupported width != 1");
if (width != 1) {
auto tenType = self.cast<TensorType>();
auto shape = tenType.getShape();
SmallVector<int64_t, 4> newShape;
newShape.push_back(width);
newShape.append(shape.begin(), shape.end());
return RankedTensorType::get(newShape, tenType.getElementType());
}
return self;
}

Expand Down