TensorDistribution<T>.generate constructor
TensorDistribution<T>.generate (
- TensorShape shape,
- Distribution<
T> generator(- TensorShape shape,
- int index
Generates distribution for each index independently.
Implementation
factory TensorDistribution.generate(
TensorShape shape,
Distribution<T> Function(TensorShape shape, int index) generator,
) {
final distributions =
List<Distribution<T>>.generate(shape.numberOfElements, (index) {
return generator(shape, index);
});
return _TensorDistribution<T>(shape, distributions);
}