mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Fix for mainz model (#4744)
* fix for mainz model * fix build * on comments * revert the extra check * on comments Co-authored-by: Ethan Tao <ettao@microsoft.com>
This commit is contained in:
parent
f3b0c93a45
commit
2605af9a0b
3 changed files with 4 additions and 1 deletions
|
|
@ -323,7 +323,7 @@ class PlannerImpl {
|
|||
// Find if freelist contains a buffer of the same size as output_arg
|
||||
bool FindReusableTensor(const onnxruntime::NodeArg& output_arg, OrtValueIndex* reusable_tensor) {
|
||||
auto p_required_buffer_shape = context_.GetShape(output_arg);
|
||||
if (nullptr == p_required_buffer_shape) return false;
|
||||
if (nullptr == p_required_buffer_shape || p_required_buffer_shape->dim_size() == 0) return false;
|
||||
auto& required_memory_info = AllocPlan(output_arg.Name()).location;
|
||||
if (HasFence(&output_arg)) return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ static std::unordered_map<std::string, std::unordered_set<size_t>>
|
|||
{"OneHot", {0, 1, 2}},
|
||||
{"Where", {0}},
|
||||
{"Range", {0, 1, 2}},
|
||||
{"Tile", {1}},
|
||||
{"BroadcastGradientArgs", {0, 1}}};
|
||||
|
||||
class GradientGraphBuilder {
|
||||
|
|
|
|||
|
|
@ -91,6 +91,8 @@ Status GetShape(const ArgDef& arg_def, std::vector<Dimension>& shape) {
|
|||
"During GetShape, ", arg_def.name, "'s shape is null.");
|
||||
const auto& dims = arg_def.type_proto->tensor_type().shape().dim();
|
||||
for (auto dim = dims.begin(); dim < dims.end(); dim++) {
|
||||
ORT_RETURN_IF_NOT(dim->dim_value() > 0 || dim->has_dim_param(),
|
||||
"During GetShape, ", arg_def.name, "'s dim value is invalid ", dim->dim_value());
|
||||
shape.push_back(*dim);
|
||||
}
|
||||
return Status::OK();
|
||||
|
|
|
|||
Loading…
Reference in a new issue