Permalink
Commits on Jan 30, 2018
  1. Implement Send + Sync for GraphImpl/Operation.

    danieldk committed Jan 30, 2018
    According to the Tensorflow C API documentation:
    
      Graphs may be shared between sessions. Graphs are thread-safe when
      used as directed below.
    
    Which presumably means when you use the C API as intended --- the C
    API uses a mutex to control graph access/modification.
Commits on Jan 29, 2018
  1. Fix compiler warning in change set.

    danieldk committed Jan 29, 2018
  2. Make TensorInner public.

    danieldk committed Jan 29, 2018
Commits on Jan 28, 2018
  1. Add changes suggested by Adam Crume.

    danieldk committed Jan 28, 2018
Commits on Jan 25, 2018
  1. Remove remainers unused method.

    danieldk committed Jan 25, 2018
  2. Mark TensorDataCRepr Send + Sync.

    danieldk committed Jan 25, 2018
  3. Avoid Cell for TensorTypes with identtical Rust/C representations.

    danieldk committed Jan 25, 2018
    Tensor instances cannot be passed between threads, because Cell
    is used for interior mutability to (lazily) unpack tensors of
    types where the C and Rust representation differ.
    
    This change creates two different tensor representations:
    
    - TensorDataCRepr for types with identical C/Rust representations.
    - TensorDataNoCRepr for types with different C/Rust representations.
    
    Since TensorDataCRepr does not need unpacking, it is free from interior
    mutability.
    
    One of these two representations is used in Tensor, based on the tensor's
    type.
Commits on Nov 18, 2017
  1. Tensor: data for C types is not initialized to zero.

    danieldk committed Nov 18, 2017
Commits on Jun 4, 2017
  1. Fix a memory leak in Buffer.

    danieldk committed Jun 4, 2017
    The Buffer type seems to conflate ownership of the TF_Buffer object and the
    ownership of the data wrapped by the TF_Buffer object.
    
    A TF_Buffer object created through from_ptr() is created as 'borrowed'. As
    a result, the TF_Buffer object is not deallocated, leadning to a memory
    leak.
    
    This commit makes two small changes to (hopefully) remedy the leak:
    
    - from_ptr() sets the TF_Buffer to be owned, so that the drop() will
      deallocate the TF_Buffer object. Since the TF_Buffer does not have
      a data_deallocator set, the data is not freed when Buffer is dropped.
    - into_ptr() does not change the TF_Buffer ownership, but instead sets
      data_deallocator to NULL. As a consequence, the caller becomes responsible
      for freeing the data and the TF_Buffer is deallocated by drop().
  2. TF_Run caller retains object ownership since 0.12.

    danieldk committed Jun 4, 2017