def _make_savable(self, name): stamp_token, state, are_buckets_ready, buckets = ( gen_quantile_ops.quantile_accumulator_serialize( self._quantile_accumulator_handle)) # slice_spec is useful for saving a slice from a variable. # It's not meaningful in quantile accumulator. slice_spec = "" def make_save_spec(tensor, suffix): return saver.BaseSaverBuilder.SaveSpec(tensor, slice_spec, name + suffix) specs = [make_save_spec(stamp_token, "_stamp")] specs += [make_save_spec(state, "_state")] specs += [make_save_spec(are_buckets_ready, "_are_buckets_ready")] specs += [make_save_spec(buckets, "buckets")] super(QuantileAccumulator, self).__init__(self._quantile_accumulator_handle, specs, name) ops.add_to_collection(ops.GraphKeys.SAVEABLE_OBJECTS, self)
def __init__(self, resource_handle, create_op, name): self._resource_handle = resource_handle self._create_op = create_op stamp_token, state, are_buckets_ready, buckets = ( gen_quantile_ops.quantile_accumulator_serialize(resource_handle)) # slice_spec is useful for saving a slice from a variable. # It's not meaningful in quantile accumulator. slice_spec = "" def make_save_spec(tensor, suffix): return saver.BaseSaverBuilder.SaveSpec(tensor, slice_spec, name + suffix) specs = [make_save_spec(stamp_token, "_stamp")] specs += [make_save_spec(state, "_state")] specs += [make_save_spec(are_buckets_ready, "_are_buckets_ready")] specs += [make_save_spec(buckets, "buckets")] super(QuantileAccumulatorSaveable, self).__init__(self._resource_handle, specs, name)
def _make_savable(self, name): stamp_token, state, are_buckets_ready, buckets = ( gen_quantile_ops.quantile_accumulator_serialize( self._quantile_accumulator_handle)) # slice_spec is useful for saving a slice from a variable. # It's not meaningful in quantile accumulator. slice_spec = "" def make_save_spec(tensor, suffix): return saver.BaseSaverBuilder.SaveSpec(tensor, slice_spec, name + suffix) specs = [make_save_spec(stamp_token, "_stamp")] specs += [make_save_spec(state, "_state")] specs += [make_save_spec(are_buckets_ready, "_are_buckets_ready")] specs += [make_save_spec(buckets, "buckets")] super(QuantileAccumulator, self).__init__(self._quantile_accumulator_handle, specs, name) ops.add_to_collection(ops.GraphKeys.SAVEABLE_OBJECTS, self)