Exemple #1
0
 def arg_builder(spacing=spacing):
     args = protobufs.SpaceRepeatSamplerArgs()
     args.spacing = spacing
     sampling_args = protobufs.SamplingArgs()
     sampling_args.sampling_function = "SpaceRepeat"
     sampling_args.sampling_args = args.SerializeToString()
     return sampling_args
Exemple #2
0
 def arg_builder(rows=rows):
     args = protobufs.GatherSamplerArgs()
     args.rows[:] = rows
     sampling_args = protobufs.SamplingArgs()
     sampling_args.sampling_function = 'Gather'
     sampling_args.sampling_args = args.SerializeToString()
     return sampling_args
Exemple #3
0
 def arg_builder(stride=stride):
     args = protobufs.StridedSamplerArgs()
     args.stride = stride
     sampling_args = protobufs.SamplingArgs()
     sampling_args.sampling_function = "Strided"
     sampling_args.sampling_args = args.SerializeToString()
     return sampling_args
Exemple #4
0
 def strided(self, stride, group_size=DEFAULT_GROUP_SIZE):
     args = protobufs.StridedPartitionerArgs()
     args.stride = stride
     args.group_size = group_size
     sampling_args = protobufs.SamplingArgs()
     sampling_args.sampling_function = 'Strided'
     sampling_args.sampling_args = args.SerializeToString()
     return sampling_args
Exemple #5
0
 def gather(self, groups):
     args = protobufs.GatherSamplerArgs()
     for rows in groups:
         gather_group = args.groups_add()
         gather_group.rows[:] = rows
     sampling_args = protobufs.SamplingArgs()
     sampling_args.sampling_function = 'Gather'
     sampling_args.sampling_args = args.SerializeToString()
     return sampling_args
Exemple #6
0
 def arg_builder(start, end, stride):
     args = protobufs.StridedRangeSamplerArgs()
     args.stride = stride
     args.starts.append(start)
     args.ends.append(end)
     sampling_args = protobufs.SamplingArgs()
     sampling_args.sampling_function = "StridedRanges"
     sampling_args.sampling_args = args.SerializeToString()
     return sampling_args
Exemple #7
0
 def strided_ranges(self, intervals, stride):
     args = protobufs.StridedRangePartitionerArgs()
     args.stride = stride
     for start, end in intervals:
         args.starts.append(start)
         args.ends.append(end)
     sampling_args = protobufs.SamplingArgs()
     sampling_args.sampling_function = 'StridedRange'
     sampling_args.sampling_args = args.SerializeToString()
     return sampling_args
Exemple #8
0
 def arg_builder():
     sampling_args = protobufs.SamplingArgs()
     sampling_args.sampling_function = "All"
     return sampling_args