-
Notifications
You must be signed in to change notification settings - Fork 177
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
Bug510 #511
Bug510 #511
Conversation
Adding 'num_batches_tracked' to BatcNorm{123}d
Mostly looks good to me, except the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd squash.
var splits = target.Split('.'); | ||
if (splits.Length > 1) { | ||
foreach (var child in named_children().Where(nc => nc.name == splits[0])) { | ||
if (child.module.has_parameter(target.Remove(0, splits[0].Length + 1))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: target[(splits[0].Length + 2)..]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth doing if it's more than trivially faster, otherwise I'll leave as is.
if (target is null) throw new ArgumentNullException("target"); | ||
if (_internal_buffers.TryGetValue(target, out var buffer)) { | ||
return buffer; | ||
} | ||
|
||
var splits = target.Split('.'); | ||
if (splits.Length > 1) { | ||
foreach (var child in named_children().Where(nc => nc.name == splits[0])) { | ||
var p = child.module.get_buffer(target.Remove(0, splits[0].Length + 1)); | ||
if (p is not null) | ||
return p; | ||
} | ||
} | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: this repeats a bit. Perhaps make a T get_named<T>(name, internal_collection, getter)
?
Addressing #510